diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2021-02-21 16:15:23 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2021-02-21 16:15:23 +0100 |
commit | 14eb49be1bd317c34d7cbf7c530e1fb85c66623a (patch) | |
tree | a750f88b18fe3354113fa2cbe30aecdeeec432c0 /vespalib | |
parent | 3e398eaf1db5847602f54cac33bf3c76718631fa (diff) |
Use constexpr for BTree traits.
Diffstat (limited to 'vespalib')
-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>; |