diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-06-11 08:42:47 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-06-11 08:42:47 +0000 |
commit | 224538cf4acc96a079ffc3761f7f8e2ba1b2bcca (patch) | |
tree | 2c602305ad3828ef382839303f0f751ccf381af9 | |
parent | ee20895ae6949f24ad29dd3808d3f46db03d6d35 (diff) |
Remove assert no longer necessary.
-rw-r--r-- | vespalib/src/vespa/vespalib/btree/btreeiterator.hpp | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/vespalib/src/vespa/vespalib/btree/btreeiterator.hpp b/vespalib/src/vespa/vespalib/btree/btreeiterator.hpp index b26f249c51b..13d41ef61f3 100644 --- a/vespalib/src/vespa/vespalib/btree/btreeiterator.hpp +++ b/vespalib/src/vespa/vespalib/btree/btreeiterator.hpp @@ -9,8 +9,6 @@ namespace search::btree { -#define STRICT_BTREE_ITERATOR_SEEK - template <typename KeyT, typename DataT, typename AggrT, uint32_t INTERNAL_SLOTS, uint32_t LEAF_SLOTS, uint32_t PATH_SIZE> BTreeIteratorBase<KeyT, DataT, AggrT, INTERNAL_SLOTS, LEAF_SLOTS, PATH_SIZE>:: @@ -81,10 +79,7 @@ operator=(const BTreeIteratorBase &other) template <typename KeyT, typename DataT, typename AggrT, uint32_t INTERNAL_SLOTS, uint32_t LEAF_SLOTS, uint32_t PATH_SIZE> -BTreeIteratorBase<KeyT, DataT, AggrT, INTERNAL_SLOTS, LEAF_SLOTS, PATH_SIZE>:: -~BTreeIteratorBase() -{ -} +BTreeIteratorBase<KeyT, DataT, AggrT, INTERNAL_SLOTS, LEAF_SLOTS, PATH_SIZE>::~BTreeIteratorBase() = default; template <typename KeyT, typename DataT, typename AggrT, uint32_t INTERNAL_SLOTS, uint32_t LEAF_SLOTS, uint32_t PATH_SIZE> @@ -674,11 +669,7 @@ BTreeConstIterator<KeyT, DataT, AggrT, CompareT, TraitsT>:: binarySeek(const KeyType & key, CompareT comp) { const LeafNodeType *lnode = _leaf.getNode(); - uint32_t lidx = _leaf.getIdx(); -#ifdef STRICT_BTREE_ITERATOR_SEEK - assert(_leaf.valid() && comp(lnode->getKey(lidx), key)); -#endif - ++lidx; + uint32_t lidx = _leaf.getIdx() + 1; if (lidx < lnode->validSlots()) { if (!comp(lnode->getKey(lidx), key)) { _leaf.setIdx(lidx); @@ -723,11 +714,7 @@ BTreeConstIterator<KeyT, DataT, AggrT, CompareT, TraitsT>:: linearSeek(const KeyType & key, CompareT comp) { const LeafNodeType *lnode = _leaf.getNode(); - uint32_t lidx = _leaf.getIdx(); -#ifdef STRICT_BTREE_ITERATOR_SEEK - assert(_leaf.valid() && comp(lnode->getKey(lidx), key)); -#endif - ++lidx; + uint32_t lidx = _leaf.getIdx() + 1; if (lidx < lnode->validSlots()) { if (!comp(lnode->getKey(lidx), key)) { _leaf.setIdx(lidx); @@ -792,11 +779,7 @@ BTreeConstIterator<KeyT, DataT, AggrT, CompareT, TraitsT>:: binarySeekPast(const KeyType & key, CompareT comp) { const LeafNodeType *lnode = _leaf.getNode(); - uint32_t lidx = _leaf.getIdx(); -#ifdef STRICT_BTREE_ITERATOR_SEEK - assert(_leaf.valid() && !comp(key, lnode->getKey(lidx))); -#endif - ++lidx; + uint32_t lidx = _leaf.getIdx() + 1; if (lidx < lnode->validSlots()) { if (comp(key, lnode->getKey(lidx))) { _leaf.setIdx(lidx); @@ -841,11 +824,8 @@ BTreeConstIterator<KeyT, DataT, AggrT, CompareT, TraitsT>:: linearSeekPast(const KeyType & key, CompareT comp) { const LeafNodeType *lnode = _leaf.getNode(); - uint32_t lidx = _leaf.getIdx(); -#ifdef STRICT_BTREE_ITERATOR_SEEK - assert(_leaf.valid() && !comp(key, lnode->getKey(lidx))); -#endif - ++lidx; + uint32_t lidx = _leaf.getIdx() + 1; + if (lidx < lnode->validSlots()) { if (comp(key, lnode->getKey(lidx))) { _leaf.setIdx(lidx); |