summaryrefslogtreecommitdiffstats
path: root/src/matcher.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-02-18 00:08:17 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-02-18 00:08:17 +0900
commite808151c287513c9aef35be339b10a2861115ade (patch)
tree3f43b5951c61760f0b7cc85a68639b82a0ac615a /src/matcher.go
parentd760b790b37a5d26b3068ed9f5b4efcaa3cf5cae (diff)
Make --select-1 and --exit-0 asynchronous
Diffstat (limited to 'src/matcher.go')
-rw-r--r--src/matcher.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/matcher.go b/src/matcher.go
index bbd9c890..84130b23 100644
--- a/src/matcher.go
+++ b/src/matcher.go
@@ -86,7 +86,7 @@ func (m *Matcher) Loop() {
}
if !foundCache {
- merger, cancelled = m.scan(request, 0)
+ merger, cancelled = m.scan(request)
}
if !cancelled {
@@ -121,7 +121,7 @@ type partialResult struct {
matches []*Item
}
-func (m *Matcher) scan(request MatchRequest, limit int) (*Merger, bool) {
+func (m *Matcher) scan(request MatchRequest) (*Merger, bool) {
startedAt := time.Now()
numChunks := len(request.chunks)
@@ -175,10 +175,6 @@ func (m *Matcher) scan(request MatchRequest, limit int) (*Merger, bool) {
count++
matchCount += matchesInChunk
- if limit > 0 && matchCount > limit {
- return nil, wait() // For --select-1 and --exit-0
- }
-
if count == numChunks {
break
}