diff --git a/erts/emulator/beam/hash.c b/erts/emulator/beam/hash.c index 5c8b43e6e26d..67febabe8fce 100644 --- a/erts/emulator/beam/hash.c +++ b/erts/emulator/beam/hash.c @@ -98,10 +98,8 @@ void hash_info(fmtfn_t to, void *arg, Hash* h) int hash_table_sz(Hash *h) { - int i; - for(i=0;h->name[i];i++); - i++; - return sizeof(Hash) + hash_get_slots(h)*sizeof(HashBucket*) + i; + const int name_len = strlen(h->name) + 1; + return sizeof(Hash) + hash_get_slots(h)*sizeof(HashBucket*) + name_len; }