From a1260feeed0cc565dfe3cca9927e1f21af7c80ef Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 19 Jul 2019 06:22:35 +0200 Subject: Code cleanup (#1640) - Replaced time.Now().Sub() with time.Since() - Replaced unnecessary string/byte slice conversions - Removed obsolete return and value assignment in range loop --- src/matcher.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/matcher.go') diff --git a/src/matcher.go b/src/matcher.go index 3c5dec09..69250873 100644 --- a/src/matcher.go +++ b/src/matcher.go @@ -207,13 +207,13 @@ func (m *Matcher) scan(request MatchRequest) (*Merger, bool) { return nil, wait() } - if time.Now().Sub(startedAt) > progressMinDuration { + if time.Since(startedAt) > progressMinDuration { m.eventBox.Set(EvtSearchProgress, float32(count)/float32(numChunks)) } } partialResults := make([][]Result, numSlices) - for _ = range slices { + for range slices { partialResult := <-resultChan partialResults[partialResult.index] = partialResult.matches } -- cgit v1.2.3