diff options
author | Christian Muehlhaeuser <muesli@gmail.com> | 2019-07-19 06:22:35 +0200 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2019-07-19 13:22:35 +0900 |
commit | a1260feeed0cc565dfe3cca9927e1f21af7c80ef (patch) | |
tree | 86d3d6b279b5f8a2174cfb55bf895482780cc5a1 /src/matcher.go | |
parent | 7322504ad07297bf44b6a7e2b8ac7a363928e6d7 (diff) |
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
Diffstat (limited to 'src/matcher.go')
-rw-r--r-- | src/matcher.go | 4 |
1 files changed, 2 insertions, 2 deletions
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 } |