aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-03-09 16:09:10 +0100
committerGuilherme Andrade <[email protected]>2017-03-22 23:57:55 +0000
commit42ece2ed3a7022adf0568d5cd64d8df8c8e64b4b (patch)
tree6fa6747e27fb12e5d3560eb1e344d129f7b7aa5d /erts/emulator/beam
parent4855e8bd2d9933020479a4fe684a0cb8bbaf6f21 (diff)
downloadotp-42ece2ed3a7022adf0568d5cd64d8df8c8e64b4b.tar.gz
otp-42ece2ed3a7022adf0568d5cd64d8df8c8e64b4b.tar.bz2
otp-42ece2ed3a7022adf0568d5cd64d8df8c8e64b4b.zip
Cleanup some unnecessary variable initialization
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;