diff options
Diffstat (limited to 'src/t_set.c')
-rw-r--r-- | src/t_set.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/t_set.c b/src/t_set.c index fada1095a..d4afead3e 100644 --- a/src/t_set.c +++ b/src/t_set.c @@ -447,11 +447,8 @@ void srandmemberWithCountCommand(redisClient *c) { if (encoding == REDIS_ENCODING_INTSET) { retval = dictAdd(d,createStringObjectFromLongLong(llele),NULL); - } else if (ele->encoding == REDIS_ENCODING_RAW) { + } else { retval = dictAdd(d,dupStringObject(ele),NULL); - } else if (ele->encoding == REDIS_ENCODING_INT) { - retval = dictAdd(d, - createStringObjectFromLongLong((long)ele->ptr),NULL); } redisAssert(retval == DICT_OK); } @@ -479,10 +476,8 @@ void srandmemberWithCountCommand(redisClient *c) { encoding = setTypeRandomElement(set,&ele,&llele); if (encoding == REDIS_ENCODING_INTSET) { ele = createStringObjectFromLongLong(llele); - } else if (ele->encoding == REDIS_ENCODING_RAW) { + } else { ele = dupStringObject(ele); - } else if (ele->encoding == REDIS_ENCODING_INT) { - ele = createStringObjectFromLongLong((long)ele->ptr); } /* Try to add the object to the dictionary. If it already exists * free it, otherwise increment the number of objects we have |