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

@ -219,11 +219,11 @@ int setTypeRandomElement(robj *setobj, sds *sdsele, int64_t *llele) {
return setobj->encoding;
}
unsigned long setTypeSize(robj *subject) {
unsigned long setTypeSize(const robj *subject) {
if (subject->encoding == OBJ_ENCODING_HT) {
return dictSize((dict*)subject->ptr);
return dictSize((const dict*)subject->ptr);
} else if (subject->encoding == OBJ_ENCODING_INTSET) {
return intsetLen((intset*)subject->ptr);
return intsetLen((const intset*)subject->ptr);
} else {
serverPanic("Unknown set encoding");
}