From 1cf1e9eab3c60e118580c793a4ed8978aa380f7c Mon Sep 17 00:00:00 2001 From: zheng <765324639@qq.com> Date: Tue, 1 Jan 2019 00:02:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3dict.c=E4=B8=AD=E6=89=A9?= =?UTF-8?q?=E5=AE=B9=E6=9D=A1=E4=BB=B6=E9=83=A8=E5=88=86=E7=9A=84=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dict.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dict.c b/src/dict.c index 0806f4b10..aa71f3d00 100644 --- a/src/dict.c +++ b/src/dict.c @@ -1409,9 +1409,9 @@ static int _dictExpandIfNeeded(dict *d) * table (global setting) or we should avoid it but the ratio between * elements/buckets is over the "safe" threshold, we resize doubling * the number of buckets. */ - // 一下两个条件之一为真时,对字典进行扩展 - // 1)字典已使用节点数和字典大小之间的比率接近 1:1 - // 并且 dict_can_resize 为真 + // 当字典已使用节点数和字典大小之间的比率达到 1:1 + // 并且以下两个条件之一为真时,对字典进行扩展 + // 1)dict_can_resize 为真 // 2)已使用节点数和字典大小之间的比率超过 dict_force_resize_ratio if (d->ht[0].used >= d->ht[0].size && (dict_can_resize ||