diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-02-21 16:35:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-21 16:35:16 +0100 |
commit | 9f11d6e850919554503efed65362efe5c89cca54 (patch) | |
tree | 17b3717b1b501ed31e4e1e35e415167c2a6517b1 | |
parent | 8144fb581207999bf76e11a817e7cd0c7f10a0dd (diff) | |
parent | 14eb49be1bd317c34d7cbf7c530e1fb85c66623a (diff) |
Merge pull request #16614 from vespa-engine/toregge/use-constexpr-for-btree-traits
Use constexpr for BTree traits.
-rw-r--r-- | vespalib/src/tests/btree/btree_test.cpp | 8 | ||||
-rw-r--r-- | vespalib/src/tests/btree/btreeaggregation_test.cpp | 8 | ||||
-rw-r--r-- | vespalib/src/vespa/vespalib/btree/btreetraits.h | 8 |
3 files changed, 12 insertions, 12 deletions
diff --git a/vespalib/src/tests/btree/btree_test.cpp b/vespalib/src/tests/btree/btree_test.cpp index 5b4c25cb870..b71aca92cd6 100644 --- a/vespalib/src/tests/btree/btree_test.cpp +++ b/vespalib/src/tests/btree/btree_test.cpp @@ -519,10 +519,10 @@ Test::requireThatNodeSplitInsertWorks() struct BTreeStealTraits { - static const size_t LEAF_SLOTS = 6; - static const size_t INTERNAL_SLOTS = 6; - static const size_t PATH_SIZE = 20; - static const bool BINARY_SEEK = true; + static constexpr size_t LEAF_SLOTS = 6; + static constexpr size_t INTERNAL_SLOTS = 6; + static constexpr size_t PATH_SIZE = 20; + static constexpr bool BINARY_SEEK = true; }; void diff --git a/vespalib/src/tests/btree/btreeaggregation_test.cpp b/vespalib/src/tests/btree/btreeaggregation_test.cpp index 67f5eda4b59..9ce57dbaf1d 100644 --- a/vespalib/src/tests/btree/btreeaggregation_test.cpp +++ b/vespalib/src/tests/btree/btreeaggregation_test.cpp @@ -598,10 +598,10 @@ Test::requireThatTreeInsertWorks() struct BTreeStealTraits { - static const size_t LEAF_SLOTS = 6; - static const size_t INTERNAL_SLOTS = 6; - static const size_t PATH_SIZE = 20; - static const bool BINARY_SEEK = true; + static constexpr size_t LEAF_SLOTS = 6; + static constexpr size_t INTERNAL_SLOTS = 6; + static constexpr size_t PATH_SIZE = 20; + static constexpr bool BINARY_SEEK = true; }; void diff --git a/vespalib/src/vespa/vespalib/btree/btreetraits.h b/vespalib/src/vespa/vespalib/btree/btreetraits.h index 52a28799bb6..84732629a21 100644 --- a/vespalib/src/vespa/vespalib/btree/btreetraits.h +++ b/vespalib/src/vespa/vespalib/btree/btreetraits.h @@ -8,10 +8,10 @@ namespace vespalib::btree { template <size_t LS, size_t IS, size_t PS, bool BS> struct BTreeTraits { - static const size_t LEAF_SLOTS = LS; - static const size_t INTERNAL_SLOTS = IS; - static const size_t PATH_SIZE = PS; - static const bool BINARY_SEEK = BS; + static constexpr size_t LEAF_SLOTS = LS; + static constexpr size_t INTERNAL_SLOTS = IS; + static constexpr size_t PATH_SIZE = PS; + static constexpr bool BINARY_SEEK = BS; }; using BTreeDefaultTraits = BTreeTraits<16, 16, 10, true>; |