refactor
This commit is contained in:
parent
36bea4fdb7
commit
16f38a9929
@ -72,8 +72,8 @@ type Main struct {
|
|||||||
progress Progress
|
progress Progress
|
||||||
total int
|
total int
|
||||||
termWidth int
|
termWidth int
|
||||||
fps *RateCalc
|
fps *util.RateCalc
|
||||||
bps *RateCalc
|
bps *util.RateCalc
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Main) log(text string) {
|
func (m *Main) log(text string) {
|
||||||
@ -331,8 +331,8 @@ func main() {
|
|||||||
m := &Main{
|
m := &Main{
|
||||||
logger: log.New(io.Discard, "", 0),
|
logger: log.New(io.Discard, "", 0),
|
||||||
termWidth: termWidth,
|
termWidth: termWidth,
|
||||||
fps: NewRateCalc(time.Second, (termWidth-70)/2),
|
fps: util.NewRateCalc(time.Second, (termWidth-70)/2),
|
||||||
bps: NewRateCalc(time.Second, (termWidth-70)/2),
|
bps: util.NewRateCalc(time.Second, (termWidth-70)/2),
|
||||||
}
|
}
|
||||||
m.run()
|
m.run()
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package main
|
package util
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
2
index.go
2
index.go
@ -225,7 +225,7 @@ func (i *Index) load() error {
|
|||||||
}
|
}
|
||||||
text := data.IdxRaw
|
text := data.IdxRaw
|
||||||
if data.IdxHash != HashMd5(text) {
|
if data.IdxHash != HashMd5(text) {
|
||||||
// old versions may have save the JSON encoded with extra spaces
|
// old versions may have saved the JSON encoded with extra spaces
|
||||||
text, _ = json.Marshal(data.IdxRaw)
|
text, _ = json.Marshal(data.IdxRaw)
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user