Skip to content

Commit

Permalink
erts: Use strlen
Browse files Browse the repository at this point in the history
  • Loading branch information
sverker committed Jun 10, 2024
1 parent ed48468 commit c99ad74
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions erts/emulator/beam/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


Expand Down

0 comments on commit c99ad74

Please sign in to comment.