summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-11-16 20:02:15 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-11-16 20:02:15 +0000
commit4c78ffc8e419ee81cd5b85263e535a279e613aa5 (patch)
tree420e53e2c0424ae24730aa970e197fa6845ed635 /vespalib
parentff4546f393f5e2ece01be654610dd9b2170ef200 (diff)
Inline -- operator
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/vespa/vespalib/btree/btreeiterator.h15
-rw-r--r--vespalib/src/vespa/vespalib/btree/btreeiterator.hpp19
2 files changed, 13 insertions, 21 deletions
diff --git a/vespalib/src/vespa/vespalib/btree/btreeiterator.h b/vespalib/src/vespa/vespalib/btree/btreeiterator.h
index 153fb005f00..6524f697f4c 100644
--- a/vespalib/src/vespa/vespalib/btree/btreeiterator.h
+++ b/vespalib/src/vespa/vespalib/btree/btreeiterator.h
@@ -161,7 +161,7 @@ private:
/*
* Find the next leaf node, called by operator++() as needed.
*/
- void findNextLeafNode();
+ VESPA_DLL_LOCAL void findNextLeafNode();
/*
* Find the previous leaf node, called by operator--() as needed.
@@ -219,7 +219,18 @@ protected:
* Step iterator backwards. If at end then place it at last valid
* position in tree (cf. rbegin())
*/
- BTreeIteratorBase & operator--();
+ BTreeIteratorBase & operator--() {
+ if (_leaf.getNode() == nullptr) {
+ rbegin();
+ return *this;
+ }
+ if (_leaf.getIdx() > 0u) {
+ _leaf.decIdx();
+ return *this;
+ }
+ findPrevLeafNode();
+ return *this;
+ }
~BTreeIteratorBase();
BTreeIteratorBase(const BTreeIteratorBase &other);
diff --git a/vespalib/src/vespa/vespalib/btree/btreeiterator.hpp b/vespalib/src/vespa/vespalib/btree/btreeiterator.hpp
index 5f15ebc8b61..fdab3a94a5b 100644
--- a/vespalib/src/vespa/vespalib/btree/btreeiterator.hpp
+++ b/vespalib/src/vespa/vespalib/btree/btreeiterator.hpp
@@ -461,25 +461,6 @@ BTreeIteratorBase() noexcept
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<KeyT, DataT, AggrT, INTERNAL_SLOTS, LEAF_SLOTS, PATH_SIZE>::
-operator--()
-{
- if (_leaf.getNode() == nullptr) {
- rbegin();
- return *this;
- }
- if (_leaf.getIdx() > 0u) {
- _leaf.decIdx();
- return *this;
- }
- findPrevLeafNode();
- return *this;
-}
-
-
-template <typename KeyT, typename DataT, typename AggrT,
- uint32_t INTERNAL_SLOTS, uint32_t LEAF_SLOTS, uint32_t PATH_SIZE>
size_t
BTreeIteratorBase<KeyT, DataT, AggrT, INTERNAL_SLOTS, LEAF_SLOTS, PATH_SIZE>::
size() const noexcept