Fix race conditions

- Wait for completions of goroutines when cancelling a search
- Remove shared access to rank field of Item
This commit is contained in:
Junegunn Choi committed 2015-01-11 23:49:12 +09:00
1 parent 1db68a3976
commit 9dbf6b02d2
7 files changed
+49 -23

No files matched your search

+1 -1
View File
@@ -57,7 +57,7 @@ func (mg *Merger) mergedGet(idx int) *Item {
continue
}
if cursor >= 0 {
rank := list[cursor].Rank()
rank := list[cursor].Rank(false)
if minIdx < 0 || compareRanks(rank, minRank) {
minRank = rank
minIdx = listIdx