]> git.saurik.com Git - redis.git/blobdiff - src/t_hash.c
Suppress warnings compiling redis-cli with certain gcc versions.
[redis.git] / src / t_hash.c
index f0ecefc32aa654f1b3a74bce47d841c1a6f3fd3d..b3928450533d2f0732010925db980a2f4ca2e0d1 100644 (file)
@@ -75,10 +75,7 @@ int hashTypeGetFromHashTable(robj *o, robj *field, robj **value) {
     redisAssert(o->encoding == REDIS_ENCODING_HT);
 
     de = dictFind(o->ptr, field);
-    if (de == NULL) {
-        return -1;
-    }
-
+    if (de == NULL) return -1;
     *value = dictGetVal(de);
     return 0;
 }
@@ -112,11 +109,9 @@ robj *hashTypeGetObject(robj *o, robj *field) {
             incrRefCount(aux);
             value = aux;
         }
-
     } else {
         redisPanic("Unknown hash encoding");
     }
-
     return value;
 }
 
@@ -128,21 +123,14 @@ int hashTypeExists(robj *o, robj *field) {
         unsigned int vlen = UINT_MAX;
         long long vll = LLONG_MAX;
 
-        if (hashTypeGetFromZiplist(o, field, &vstr, &vlen, &vll) == 0) {
-            return 1;
-        }
-
+        if (hashTypeGetFromZiplist(o, field, &vstr, &vlen, &vll) == 0) return 1;
     } else if (o->encoding == REDIS_ENCODING_HT) {
         robj *aux;
 
-        if (hashTypeGetFromHashTable(o, field, &aux) == 0) {
-            return 1;
-        }
-
+        if (hashTypeGetFromHashTable(o, field, &aux) == 0) return 1;
     } else {
         redisPanic("Unknown hash encoding");
     }
-
     return 0;
 }
 
@@ -306,10 +294,7 @@ int hashTypeNext(hashTypeIterator *hi) {
             redisAssert(vptr != NULL);
             fptr = ziplistNext(zl, vptr);
         }
-
-        if (fptr == NULL) {
-            return REDIS_ERR;
-        }
+        if (fptr == NULL) return REDIS_ERR;
 
         /* Grab pointer to the value (fptr points to the field) */
         vptr = ziplistNext(zl, fptr);
@@ -318,16 +303,11 @@ int hashTypeNext(hashTypeIterator *hi) {
         /* fptr, vptr now point to the first or next pair */
         hi->fptr = fptr;
         hi->vptr = vptr;
-
     } else if (hi->encoding == REDIS_ENCODING_HT) {
-        if ((hi->de = dictNext(hi->di)) == NULL) {
-            return REDIS_ERR;
-        }
-
+        if ((hi->de = dictNext(hi->di)) == NULL) return REDIS_ERR;
     } else {
         redisPanic("Unknown hash encoding");
     }
-
     return REDIS_OK;
 }