| 1314 | } |
| 1315 | |
| 1316 | int dictEncObjKeyCompare(void *privdata, const void *key1, |
| 1317 | const void *key2) |
| 1318 | { |
| 1319 | robj *o1 = (robj*) key1, *o2 = (robj*) key2; |
| 1320 | int cmp; |
| 1321 | |
| 1322 | if (o1->encoding == OBJ_ENCODING_INT && |
| 1323 | o2->encoding == OBJ_ENCODING_INT) |
| 1324 | return o1->ptr == o2->ptr; |
| 1325 | |
| 1326 | /* Due to OBJ_STATIC_REFCOUNT, we avoid calling getDecodedObject() without |
| 1327 | * good reasons, because it would incrRefCount() the object, which |
| 1328 | * is invalid. So we check to make sure dictFind() works with static |
| 1329 | * objects as well. */ |
| 1330 | if (o1->refcount != OBJ_STATIC_REFCOUNT) o1 = getDecodedObject(o1); |
| 1331 | if (o2->refcount != OBJ_STATIC_REFCOUNT) o2 = getDecodedObject(o2); |
| 1332 | cmp = dictSdsKeyCompare(privdata,o1->ptr,o2->ptr); |
| 1333 | if (o1->refcount != OBJ_STATIC_REFCOUNT) decrRefCount(o1); |
| 1334 | if (o2->refcount != OBJ_STATIC_REFCOUNT) decrRefCount(o2); |
| 1335 | return cmp; |
| 1336 | } |
| 1337 | |
| 1338 | uint64_t dictEncObjHash(const void *key) { |
| 1339 | robj *o = (robj*) key; |
nothing calls this directly
no test coverage detected