diff --git a/src/hashtable.c b/src/hashtable.c index 3f1eff19c1..34185ae5c5 100644 --- a/src/hashtable.c +++ b/src/hashtable.c @@ -2183,11 +2183,12 @@ int hashtableLongestBucketChain(hashtable *ht) { int chainlen = 0; bucket *b = &ht->tables[table][i]; while (b->chained) { - if (++chainlen > maxlen) { - maxlen = chainlen; - } + ++chainlen b = getChildBucket(b); } + if (chainlen > maxlen) { + maxlen = chainlen; + } } } return maxlen;