未验证 提交 73316758 编写于 作者: S Salvatore Sanfilippo 提交者: GitHub

Merge pull request #7152 from oranagra/dict_find_static_robj

allow dictFind using static robj
......@@ -1219,10 +1219,15 @@ int dictEncObjKeyCompare(void *privdata, const void *key1,
o2->encoding == OBJ_ENCODING_INT)
return o1->ptr == o2->ptr;
/* due to OBJ_STATIC_REFCOUNT, we rather not call sdsEncodedObject unnecessarily */
if (!sdsEncodedObject(o1))
o1 = getDecodedObject(o1);
if (!sdsEncodedObject(o2))
o2 = getDecodedObject(o2);
cmp = dictSdsKeyCompare(privdata,o1->ptr,o2->ptr);
if (o1!=key1)
decrRefCount(o1);
if (o2!=key2)
decrRefCount(o2);
return cmp;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册