rehash MS does too little work before checking the time

Former-commit-id: 3e57b5c961f7dd91ddb24331eba9a3fa39b08fdd
This commit is contained in:
John Sully 2019-11-29 15:18:37 -05:00
parent 5012176262
commit 6cb89c9aee

View File

@ -242,8 +242,8 @@ int dictRehashMilliseconds(dict *d, int ms) {
long long start = timeInMilliseconds(); long long start = timeInMilliseconds();
int rehashes = 0; int rehashes = 0;
while(dictRehash(d,100)) { while(dictRehash(d,1000)) {
rehashes += 100; rehashes += 1000;
if (timeInMilliseconds()-start > ms) break; if (timeInMilliseconds()-start > ms) break;
} }
return rehashes; return rehashes;