diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-09-06 16:12:53 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-09-06 16:14:22 +0800 |
commit | 564c8f3ae6f80d039ef27479e5ad15145f488710 (patch) | |
tree | 6ea0ba7265588c7979ff6a76c107b607306c5e01 /core/bloombits/matcher.go | |
parent | 451ffdb62b43bab66188f3f7eeb2131b65415ccb (diff) | |
download | go-tangerine-564c8f3ae6f80d039ef27479e5ad15145f488710.tar.gz go-tangerine-564c8f3ae6f80d039ef27479e5ad15145f488710.tar.zst go-tangerine-564c8f3ae6f80d039ef27479e5ad15145f488710.zip |
core/bloombits: drop nil-matcher special case
Diffstat (limited to 'core/bloombits/matcher.go')
-rw-r--r-- | core/bloombits/matcher.go | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/core/bloombits/matcher.go b/core/bloombits/matcher.go index df0967a12..f3ed405a6 100644 --- a/core/bloombits/matcher.go +++ b/core/bloombits/matcher.go @@ -17,6 +17,7 @@ package bloombits import ( + "bytes" "errors" "math" "sort" @@ -171,15 +172,6 @@ func (m *Matcher) Start(begin, end uint64, results chan uint64) (*MatcherSession } // Iterate over all the blocks in the section and return the matching ones for i := first; i <= last; i++ { - // If the bitset is nil, we're a special match-all cornercase - if res.bitset == nil { - select { - case <-session.quit: - return - case results <- i: - } - continue - } // Skip the entire byte if no matches are found inside next := res.bitset[(i-sectionStart)/8] if next == 0 { @@ -221,7 +213,7 @@ func (m *Matcher) run(begin, end uint64, buffer int, session *MatcherSession) ch select { case <-session.quit: return - case source <- &partialMatches{i, nil}: + case source <- &partialMatches{i, bytes.Repeat([]byte{0xff}, int(m.sectionSize/8))}: } } }() |