diff options
author | Sverker Eriksson <[email protected]> | 2015-02-17 19:27:45 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2015-03-12 19:15:25 +0100 |
commit | 7e3b9d5ab2e0c53b606a653896f3a2857ea5cbce (patch) | |
tree | faec6f8b7a4e8ccb84f80ca0881f988969b7a92d | |
parent | af34cc859ae9979e9f4f8abf29646efd6b1c9c04 (diff) | |
download | otp-7e3b9d5ab2e0c53b606a653896f3a2857ea5cbce.tar.gz otp-7e3b9d5ab2e0c53b606a653896f3a2857ea5cbce.tar.bz2 otp-7e3b9d5ab2e0c53b606a653896f3a2857ea5cbce.zip |
erts: Add micro optimization to phash2 of tuples
-rw-r--r-- | erts/emulator/beam/utils.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c index 0f2d89bbfe..3f9cb5dbea 100644 --- a/erts/emulator/beam/utils.c +++ b/erts/emulator/beam/utils.c @@ -1252,11 +1252,12 @@ make_hash2(Eterm term) UINT32_HASH(arity, HCONST_9); if (arity == 0) /* Empty tuple */ goto hash2_common; - for (i = arity; i >= 1; i--) { - tmp = elem[i]; - ESTACK_PUSH(s, tmp); + for (i = arity; ; i--) { + term = elem[i]; + if (i == 1) + break; + ESTACK_PUSH(s, term); } - goto hash2_common; } break; case MAP_SUBTAG: |