]> git.saurik.com Git - redis.git/blobdiff - src/object.c
Write RDB magic using a REDIS_RDB_VERSION define that is defined inside rdb.h
[redis.git] / src / object.c
index 9699ea53e314fcb90483f55bc1bb0608a971c367..a15ebcfa8371fd25efcfa376a6cf58ad4e29bb0a 100644 (file)
@@ -48,7 +48,7 @@ robj *createStringObjectFromLongLong(long long value) {
 /* Note: this function is defined into object.c since here it is where it
  * belongs but it is actually designed to be used just for INCRBYFLOAT */
 robj *createStringObjectFromLongDouble(long double value) {
-    char buf[256], *p;
+    char buf[256];
     int len;
 
     /* We use 17 digits precision since with 128 bit floats that precision
@@ -58,8 +58,8 @@ robj *createStringObjectFromLongDouble(long double value) {
      * a string are exactly the same as what the user typed.) */
     len = snprintf(buf,sizeof(buf),"%.17Lf", value);
     /* Now remove trailing zeroes after the '.' */
-    if ((p = strchr(buf,'.')) != NULL) {
-        p = buf+len-1;
+    if (strchr(buf,'.') != NULL) {
+        char *p = buf+len-1;
         while(*p == '0') {
             p--;
             len--;
@@ -270,9 +270,7 @@ robj *tryObjectEncoding(robj *o) {
 
     /* Ok, this object can be encoded...
      *
-     * Can I use a shared object? Only if the object is inside a given
-     * range and if the back end in use is in-memory. For disk store every
-     * object in memory used as value should be independent.
+     * Can I use a shared object? Only if the object is inside a given range
      *
      * Note that we also avoid using shared integers when maxmemory is used
      * because every object needs to have a private LRU field for the LRU