mirror of
https://github.com/fluencelabs/redis
synced 2025-06-12 08:41:21 +00:00
Use const in Redis Module API where possible.
This commit is contained in:
@ -308,13 +308,13 @@ int hashTypeDelete(robj *o, sds field) {
|
||||
}
|
||||
|
||||
/* Return the number of elements in a hash. */
|
||||
unsigned long hashTypeLength(robj *o) {
|
||||
unsigned long hashTypeLength(const robj *o) {
|
||||
unsigned long length = ULONG_MAX;
|
||||
|
||||
if (o->encoding == OBJ_ENCODING_ZIPLIST) {
|
||||
length = ziplistLen(o->ptr) / 2;
|
||||
} else if (o->encoding == OBJ_ENCODING_HT) {
|
||||
length = dictSize((dict*)o->ptr);
|
||||
length = dictSize((const dict*)o->ptr);
|
||||
} else {
|
||||
serverPanic("Unknown hash encoding");
|
||||
}
|
||||
|
Reference in New Issue
Block a user