| 1408 | } |
| 1409 | |
| 1410 | int dictEncObjKeyCompare(void *privdata, const void *key1, |
| 1411 | const void *key2) |
| 1412 | { |
| 1413 | robj *o1 = (robj*) key1, *o2 = (robj*) key2; |
| 1414 | int cmp; |
| 1415 | |
| 1416 | if (o1->encoding == OBJ_ENCODING_INT && |
| 1417 | o2->encoding == OBJ_ENCODING_INT) |
| 1418 | return ptrFromObj(o1) == ptrFromObj(o2); |
| 1419 | |
| 1420 | /* Due to OBJ_STATIC_REFCOUNT, we avoid calling getDecodedObject() without |
| 1421 | * good reasons, because it would incrRefCount() the object, which |
| 1422 | * is invalid. So we check to make sure dictFind() works with static |
| 1423 | * objects as well. */ |
| 1424 | if (o1->getrefcount() != OBJ_STATIC_REFCOUNT) o1 = getDecodedObject(o1); |
| 1425 | if (o2->getrefcount() != OBJ_STATIC_REFCOUNT) o2 = getDecodedObject(o2); |
| 1426 | cmp = dictSdsKeyCompare(privdata,ptrFromObj(o1),ptrFromObj(o2)); |
| 1427 | if (o1->getrefcount() != OBJ_STATIC_REFCOUNT) decrRefCount(o1); |
| 1428 | if (o2->getrefcount() != OBJ_STATIC_REFCOUNT) decrRefCount(o2); |
| 1429 | return cmp; |
| 1430 | } |
| 1431 | |
| 1432 | uint64_t dictEncObjHash(const void *key) { |
| 1433 | robj *o = (robj*) key; |
nothing calls this directly
no test coverage detected