Like hashTypeGetValue() but returns a Redis object, which is useful for * interaction with the hash type outside t_hash.c. * The function returns NULL if the field is not found in the hash. Otherwise * a newly allocated string object with the value is returned. */
| 135 | * The function returns NULL if the field is not found in the hash. Otherwise |
| 136 | * a newly allocated string object with the value is returned. */ |
| 137 | robj *hashTypeGetValueObject(robj_roptr o, sds field) { |
| 138 | const unsigned char *vstr; |
| 139 | unsigned int vlen; |
| 140 | long long vll; |
| 141 | |
| 142 | if (hashTypeGetValue(o,field,&vstr,&vlen,&vll) == C_ERR) return NULL; |
| 143 | if (vstr) return createStringObject((char*)vstr,vlen); |
| 144 | else return createStringObjectFromLongLong(vll); |
| 145 | } |
| 146 | |
| 147 | /* Higher level function using hashTypeGet*() to return the length of the |
| 148 | * object associated with the requested field, or 0 if the field does not |
no test coverage detected