X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/ed9b544e10b84cd43348ddfab7068b610a5df1f7..6f864e62661637917ce6b449ae2c5e11538dfa1f:/dict.c?ds=sidebyside diff --git a/dict.c b/dict.c index 2d186c1d..9360d52e 100644 --- a/dict.c +++ b/dict.c @@ -33,6 +33,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include "fmacros.h" + #include #include #include @@ -375,7 +377,7 @@ dictEntry *dictGetRandomKey(dict *ht) unsigned int h; int listlen, listele; - if (ht->size == 0) return NULL; + if (ht->used == 0) return NULL; do { h = random() & ht->sizemask; he = ht->table[h];