This commit is contained in:
Christian Zangl 2024-08-19 20:42:42 +02:00
parent 36bea4fdb7
commit 16f38a9929
No known key found for this signature in database
GPG Key ID: 6D468AC36E2A4B3D
3 changed files with 6 additions and 6 deletions

View File

@ -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()
} }

View File

@ -1,4 +1,4 @@
package main package util
import ( import (
"time" "time"

View File

@ -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 {
} }