Skip to content

Commit

Permalink
INTERNAL: Move a 'replaced' initialization in btree insert
Browse files Browse the repository at this point in the history
  • Loading branch information
ing-eoking committed Jul 4, 2024
1 parent f1995f0 commit 10b233e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions engines/default/coll_btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -2209,8 +2209,6 @@ static ENGINE_ERROR_CODE do_btree_elem_link(btree_meta_info *info, btree_elem_it
int ovfl_type = OVFL_TYPE_NONE;
ENGINE_ERROR_CODE res;

if (replaced) *replaced = false;

assert(info->root->ndepth < BTREE_MAX_DEPTH);
res = do_btree_find_insposi(info->root, elem->data, elem->nbkey, path);
if (res == ENGINE_SUCCESS) {
Expand Down Expand Up @@ -3724,6 +3722,8 @@ ENGINE_ERROR_CODE btree_elem_insert(const char *key, const uint32_t nkey,
PERSISTENCE_ACTION_BEGIN(cookie, UPD_BT_ELEM_INSERT);

*created = false;
*replaced = false;

if (trimmed_elems != NULL) {
/* initialize as no trimmed element */
*trimmed_elems = NULL;
Expand Down

0 comments on commit 10b233e

Please sign in to comment.