diff options
author | Björn Gustavsson <bjorn@erlang.org> | 2020-02-10 10:37:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-10 10:37:27 +0100 |
commit | 45935098d2ae86a676e017d764024454a2fc3ce8 (patch) | |
tree | 54bc5a054fea595a77a0d651aaf39614e84cb3da /erts | |
parent | 8420c6b957f082a292e23d837d595482689fa9d2 (diff) | |
parent | b20593b3dff4fa1017110c160d6a28ebca6a295f (diff) | |
download | erlang-45935098d2ae86a676e017d764024454a2fc3ce8.tar.gz |
Merge pull request #2526 from bjorng/bjorn/erts/map-eq/OTP-16454
Optimize =:= when comparing maps
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/beam/utils.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c index d6e069f756..2f7c8dfb5e 100644 --- a/erts/emulator/beam/utils.c +++ b/erts/emulator/beam/utils.c @@ -2973,10 +2973,14 @@ tailrecur_ne: bb = hashmap_val(b) + 1; switch (hdr & _HEADER_MAP_SUBTAG_MASK) { case HAMT_SUBTAG_HEAD_ARRAY: + if (aa[0] != bb[0]) + goto not_equal; aa++; bb++; sz = 16; break; case HAMT_SUBTAG_HEAD_BITMAP: + if (aa[0] != bb[0]) + goto not_equal; aa++; bb++; case HAMT_SUBTAG_NODE_BITMAP: sz = hashmap_bitcount(MAP_HEADER_VAL(hdr)); |