Improve hash function for names.

PiperOrigin-RevId: 619173787
Change-Id: I7889ea71ebe7bdbe682042842c521d6631521a35
This commit is contained in:
Yuval Tassa
2024-03-26 06:49:58 -07:00
committed by Copybara-Service
parent 709719911e
commit fa8893b443
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -1492,7 +1492,7 @@ static int namelist(vector<T*>& list, int adr, int* name_adr, char* names, int*
continue;
}
uint64_t j = mj_hashdjb2(list[i]->name.c_str(), map_size);
uint64_t j = mj_hashString(list[i]->name.c_str(), map_size);
// find first empty slot using linear probing
for (; map[j]!=-1; j=(j+1) % map_size) {}