aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/erl_db_hash.c12
-rw-r--r--erts/emulator/beam/erl_db_tree.c10
2 files changed, 9 insertions, 13 deletions
diff --git a/erts/emulator/beam/erl_db_hash.c b/erts/emulator/beam/erl_db_hash.c
index 21af322632..569419265b 100644
--- a/erts/emulator/beam/erl_db_hash.c
+++ b/erts/emulator/beam/erl_db_hash.c
@@ -2132,16 +2132,14 @@ static int mtraversal_select_replace_on_match_res(void* context_ptr, Sint slot_i
{
mtraversal_select_replace_context_t* sr_context_ptr = (mtraversal_select_replace_context_t*) context_ptr;
DbTableHash* tb = sr_context_ptr->tb;
-#ifdef DEBUG
- Eterm key = NIL;
-#endif
- HashDbTerm* new = NULL;
- HashDbTerm* next = NULL;
- HashValue hval = INVALID_HASH;
+ HashDbTerm* new;
+ HashDbTerm* next;
+ HashValue hval;
if (is_value(match_res)) {
#ifdef DEBUG
- ASSERT(is_value(key = db_getkey(tb->common.keypos, match_res)));
+ Eterm key = db_getkey(tb->common.keypos, match_res);
+ ASSERT(is_value(key));
ASSERT(eq(key, GETKEY(tb, (**current_ptr_ptr)->dbterm.tpl)));
#endif
next = (**current_ptr_ptr)->next;
diff --git a/erts/emulator/beam/erl_db_tree.c b/erts/emulator/beam/erl_db_tree.c
index 949f8c46b6..fadd63be34 100644
--- a/erts/emulator/beam/erl_db_tree.c
+++ b/erts/emulator/beam/erl_db_tree.c
@@ -3459,10 +3459,7 @@ static int doit_select_replace(DbTableTree *tb, TreeDbTerm **this, void *ptr,
int forward)
{
struct select_replace_context *sc = (struct select_replace_context *) ptr;
- Eterm ret = NIL;
-#ifdef DEBUG
- Eterm key = NIL;
-#endif
+ Eterm ret;
sc->lastobj = (*this)->dbterm.tpl;
@@ -3477,8 +3474,9 @@ static int doit_select_replace(DbTableTree *tb, TreeDbTerm **this, void *ptr,
if (is_value(ret)) {
#ifdef DEBUG
- ASSERT(is_value(key = db_getkey(tb->common.keypos, ret)));
- ASSERT(cmp_key(tb, key, *this) == 0);
+ Eterm key = db_getkey(tb->common.keypos, ret);
+ ASSERT(is_value(key));
+ ASSERT(cmp_key(tb, key, old) == 0);
#endif
*this = replace_dbterm(tb, *this, ret);
sc->lastobj = (*this)->dbterm.tpl;