summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2019-09-24 06:06:45 +0400
committerSergey Vojtovich <svoj@mariadb.org>2019-09-24 20:26:53 +0400
commit4252be660ac64e60425ebefda0c2201f6155b7ec (patch)
treee54bb90d4e295113ecb36d589b0770d74937da8a
parenta5070998377e9597fbadea4525d001cc3dc9d0d3 (diff)
downloadmariadb-git-bb-10.5-svoj-MDEV-20630.tar.gz
lf_hash_iterate() no zero-bucket initializationbb-10.5-svoj-MDEV-20630
Return immediately if hash is empty. Part of MDEV-20630 - lf_hash get performance regression since the bucket size won't decrease
-rw-r--r--mysys/lf_hash.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/mysys/lf_hash.c b/mysys/lf_hash.c
index 6eaa439b651..8ba623b2891 100644
--- a/mysys/lf_hash.c
+++ b/mysys/lf_hash.c
@@ -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);