Use const in Redis Module API where possible.

This commit is contained in:
Yossi Gottlieb
2016-06-20 23:08:06 +03:00
parent 0b4b7ebd95
commit 8f3a4df775
13 changed files with 38 additions and 38 deletions

View File

@ -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");
}