aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-04-04 11:57:12 +0200
committerBjörn-Egil Dahlberg <[email protected]>2016-04-04 11:57:12 +0200
commit01012debc01ba667a0dffb9ae6b10b0cbb1b567e (patch)
tree6fc444e4c2880dcda2dbb2567ff84e8368b5bd12 /erts
parentc9f63aa227432e5adfb1a6743887c6c8d47a60b3 (diff)
parentf86eabba45b351890ea8a12bd976c02b799c0e93 (diff)
downloadotp-01012debc01ba667a0dffb9ae6b10b0cbb1b567e.tar.gz
otp-01012debc01ba667a0dffb9ae6b10b0cbb1b567e.tar.bz2
otp-01012debc01ba667a0dffb9ae6b10b0cbb1b567e.zip
Merge branch 'egil/erts/fix-flatmap-get/OTP-13459'
* egil/erts/fix-flatmap-get/OTP-13459: erts: Don't search for non-existing Map keys twice
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/erl_map.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/erts/emulator/beam/erl_map.c b/erts/emulator/beam/erl_map.c
index 4b6931f848..6b747256e1 100644
--- a/erts/emulator/beam/erl_map.c
+++ b/erts/emulator/beam/erl_map.c
@@ -196,13 +196,13 @@ erts_maps_get(Eterm key, Eterm map)
return &vs[i];
}
}
- }
-
- for (i = 0; i < n; i++) {
- if (EQ(ks[i], key)) {
- return &vs[i];
- }
- }
+ } else {
+ for (i = 0; i < n; i++) {
+ if (EQ(ks[i], key)) {
+ return &vs[i];
+ }
+ }
+ }
return NULL;
}
ASSERT(is_hashmap(map));