summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@oath.com>2017-09-06 09:47:01 +0000
committerTor Egge <Tor.Egge@oath.com>2017-09-06 09:47:01 +0000
commit41df5d16e770f8c6480a0dc9567cb92c5a5a885a (patch)
tree3ba699ab93752e93d3125850ea9c85685e20d5a3 /searchlib
parent0c8f9bdd5a8d6ce35e1a8adba174c51dc8583a92 (diff)
Simplify lower_bound method.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/attribute/dociditerator.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/dociditerator.h b/searchlib/src/vespa/searchlib/attribute/dociditerator.h
index 194d57a2b1a..a6366172269 100644
--- a/searchlib/src/vespa/searchlib/attribute/dociditerator.h
+++ b/searchlib/src/vespa/searchlib/attribute/dociditerator.h
@@ -42,12 +42,9 @@ public:
}
void lower_bound(uint32_t docId) {
- if (valid() && (docId > getKey())) {
- linearSeek(docId);
- } else {
- _cur = _begin;
- linearSeek(docId);
- }
+ P keyWrap;
+ keyWrap._key = docId;
+ _cur = std::lower_bound<const P *, P>(_begin, _end, keyWrap);
}
void swap(DocIdIterator &rhs) {