refactor
This commit is contained in:
parent
36bea4fdb7
commit
16f38a9929
@ -72,8 +72,8 @@ type Main struct {
|
||||
progress Progress
|
||||
total int
|
||||
termWidth int
|
||||
fps *RateCalc
|
||||
bps *RateCalc
|
||||
fps *util.RateCalc
|
||||
bps *util.RateCalc
|
||||
}
|
||||
|
||||
func (m *Main) log(text string) {
|
||||
@ -331,8 +331,8 @@ func main() {
|
||||
m := &Main{
|
||||
logger: log.New(io.Discard, "", 0),
|
||||
termWidth: termWidth,
|
||||
fps: NewRateCalc(time.Second, (termWidth-70)/2),
|
||||
bps: NewRateCalc(time.Second, (termWidth-70)/2),
|
||||
fps: util.NewRateCalc(time.Second, (termWidth-70)/2),
|
||||
bps: util.NewRateCalc(time.Second, (termWidth-70)/2),
|
||||
}
|
||||
m.run()
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package main
|
||||
package util
|
||||
|
||||
import (
|
||||
"time"
|
2
index.go
2
index.go
@ -225,7 +225,7 @@ func (i *Index) load() error {
|
||||
}
|
||||
text := data.IdxRaw
|
||||
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)
|
||||
} else {
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user