Commit 4252be66 authored by Sergey Vojtovich's avatar Sergey Vojtovich

lf_hash_iterate() no zero-bucket initialization

Return immediately if hash is empty.

Part of MDEV-20630 - lf_hash get performance regression since the bucket
                     size won't decrease
parent a5070998
......@@ -522,12 +522,9 @@ int lf_hash_iterate(LF_HASH *hash, LF_PINS *pins,
CURSOR cursor;
uint bucket= 0;
int res;
LF_SLIST * volatile *el;
LF_SLIST * volatile *el= lf_dynarray_lvalue(&hash->array, bucket);
el= lf_dynarray_lvalue(&hash->array, bucket);
if (unlikely(!el))
return 0; /* if there's no bucket==0, the hash is empty */
if (*el == NULL && unlikely(initialize_bucket(hash, el, bucket, pins)))
if (unlikely(!el) || !*el)
return 0; /* if there's no bucket==0, the hash is empty */
res= l_find(el, 0, 0, (uchar*)argument, 0, &cursor, pins, action);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment