@@ -530,7 +530,6 @@ class db final {
530530 return node_counts[as_i<NodeType>];
531531 }
532532
533- // cppcheck-suppress returnByReference
534533 [[nodiscard, gnu::pure]] constexpr auto get_node_counts () const noexcept {
535534 return node_counts;
536535 }
@@ -541,7 +540,6 @@ class db final {
541540 return growing_inode_counts[internal_as_i<NodeType>];
542541 }
543542
544- // cppcheck-suppress returnByReference
545543 [[nodiscard, gnu::pure]] constexpr auto get_growing_inode_counts ()
546544 const noexcept {
547545 return growing_inode_counts;
@@ -553,7 +551,6 @@ class db final {
553551 return shrinking_inode_counts[internal_as_i<NodeType>];
554552 }
555553
556- // cppcheck-suppress returnByReference
557554 [[nodiscard, gnu::pure]] constexpr auto get_shrinking_inode_counts ()
558555 const noexcept {
559556 return shrinking_inode_counts;
@@ -919,30 +916,30 @@ typename db<Key, Value>::get_result db<Key, Value>::get_internal(
919916
920917UNODB_DETAIL_DISABLE_MSVC_WARNING (26430 )
921918template <typename Key, typename Value>
922- bool db<Key, Value>::insert_internal(art_key_type k , value_type v) {
919+ bool db<Key, Value>::insert_internal(art_key_type insert_key , value_type v) {
923920 if (UNODB_DETAIL_UNLIKELY (root == nullptr )) {
924- auto leaf = art_policy::make_db_leaf_ptr (k , v, *this );
921+ auto leaf = art_policy::make_db_leaf_ptr (insert_key , v, *this );
925922 root = detail::node_ptr{leaf.release (), node_type::LEAF};
926923 return true ;
927924 }
928925
929926 auto * node = &root;
930927 tree_depth_type depth{};
931- auto remaining_key{k };
928+ auto remaining_key{insert_key };
932929
933930 while (true ) {
934931 const auto node_type = node->type ();
935932 if (node_type == node_type::LEAF) {
936933 auto * const leaf{node->template ptr <leaf_type*>()};
937934 const auto existing_key{leaf->get_key_view ()};
938- const auto cmp = k .cmp (existing_key);
935+ const auto cmp = insert_key .cmp (existing_key);
939936 if (UNODB_DETAIL_UNLIKELY (cmp == 0 )) {
940937 return false ; // exists
941938 }
942939 // Replace the existing leaf with a new N4 and put the existing
943940 // leaf and the leaf for the caller's key and value under the
944941 // new inode as its direct children.
945- auto new_leaf = art_policy::make_db_leaf_ptr (k , v, *this );
942+ auto new_leaf = art_policy::make_db_leaf_ptr (insert_key , v, *this );
946943 auto new_node{inode_4::create (*this , existing_key, remaining_key, depth,
947944 leaf, std::move (new_leaf))};
948945 *node = detail::node_ptr{new_node.release (), node_type::I4};
@@ -963,7 +960,7 @@ bool db<Key, Value>::insert_internal(art_key_type k, value_type v) {
963960 // than the desired match. We need to split this inode into a
964961 // new N4 whose children are the existing inode and a new child
965962 // leaf.
966- auto leaf = art_policy::make_db_leaf_ptr (k , v, *this );
963+ auto leaf = art_policy::make_db_leaf_ptr (insert_key , v, *this );
967964 auto new_node = inode_4::create (*this , *node, shared_prefix_len, depth,
968965 std::move (leaf));
969966 *node = detail::node_ptr{new_node.release (), node_type::I4};
@@ -982,7 +979,7 @@ bool db<Key, Value>::insert_internal(art_key_type k, value_type v) {
982979 remaining_key.shift_right (key_prefix_length);
983980
984981 node = inode->template add_or_choose_subtree <detail::node_ptr*>(
985- node_type, remaining_key[0 ], k , v, *this , depth, node);
982+ node_type, remaining_key[0 ], insert_key , v, *this , depth, node);
986983
987984 if (node == nullptr ) return true ;
988985
@@ -993,12 +990,12 @@ bool db<Key, Value>::insert_internal(art_key_type k, value_type v) {
993990UNODB_DETAIL_RESTORE_MSVC_WARNINGS ()
994991
995992template <typename Key, typename Value>
996- bool db<Key, Value>::remove_internal(art_key_type k ) {
993+ bool db<Key, Value>::remove_internal(art_key_type remove_key ) {
997994 if (UNODB_DETAIL_UNLIKELY (root == nullptr )) return false ;
998995
999996 if (root.type () == node_type::LEAF) {
1000997 auto * const root_leaf{root.ptr <leaf_type*>()};
1001- if (root_leaf->matches (k )) {
998+ if (root_leaf->matches (remove_key )) {
1002999 const auto r{art_policy::reclaim_leaf_on_scope_exit (root_leaf, *this )};
10031000 root = nullptr ;
10041001 return true ;
@@ -1008,7 +1005,7 @@ bool db<Key, Value>::remove_internal(art_key_type k) {
10081005
10091006 auto * node = &root;
10101007 tree_depth_type depth{};
1011- auto remaining_key{k };
1008+ auto remaining_key{remove_key };
10121009
10131010 while (true ) {
10141011 const auto node_type = node->type ();
@@ -1025,8 +1022,8 @@ bool db<Key, Value>::remove_internal(art_key_type k) {
10251022 remaining_key.shift_right (key_prefix_length);
10261023
10271024 const auto remove_result{inode->template remove_or_choose_subtree <
1028- std::optional<detail::node_ptr*>>(node_type, remaining_key[0 ], k, * this ,
1029- node)};
1025+ std::optional<detail::node_ptr*>>(node_type, remaining_key[0 ],
1026+ remove_key, * this , node)};
10301027 if (UNODB_DETAIL_UNLIKELY (!remove_result)) return false ;
10311028
10321029 auto * const child_ptr{*remove_result};
0 commit comments