Get the value from a hash table encoded hash, identified by field. * Returns NULL when the field cannot be found, otherwise the SDS value * is returned. */
| 94 | * Returns NULL when the field cannot be found, otherwise the SDS value |
| 95 | * is returned. */ |
| 96 | const char *hashTypeGetFromHashTable(robj_roptr o, const char *field) { |
| 97 | dictEntry *de; |
| 98 | |
| 99 | serverAssert(o->encoding == OBJ_ENCODING_HT); |
| 100 | |
| 101 | de = dictFind((dict*)ptrFromObj(o), field); |
| 102 | if (de == NULL) return NULL; |
| 103 | return (sds)dictGetVal(de); |
| 104 | } |
| 105 | |
| 106 | /* Higher level function of hashTypeGet*() that returns the hash value |
| 107 | * associated with the specified field. If the field is found C_OK |
no test coverage detected