| 1336 | } |
| 1337 | |
| 1338 | uint64_t dictEncObjHash(const void *key) { |
| 1339 | robj *o = (robj*) key; |
| 1340 | |
| 1341 | if (sdsEncodedObject(o)) { |
| 1342 | return dictGenHashFunction(o->ptr, sdslen((sds)o->ptr)); |
| 1343 | } else if (o->encoding == OBJ_ENCODING_INT) { |
| 1344 | char buf[32]; |
| 1345 | int len; |
| 1346 | |
| 1347 | len = ll2string(buf,32,(long)o->ptr); |
| 1348 | return dictGenHashFunction((unsigned char*)buf, len); |
| 1349 | } else { |
| 1350 | serverPanic("Unknown string encoding"); |
| 1351 | } |
| 1352 | } |
| 1353 | |
| 1354 | /* Return 1 if currently we allow dict to expand. Dict may allocate huge |
| 1355 | * memory to contain hash buckets when dict expands, that may lead redis |
nothing calls this directly
no test coverage detected