提交 f1d187bb 编写于 作者: M Michael Parker 提交者: antirez

Use correct variable name for value to convert.

Note by @antirez: this code was never compiled because utils.c lacked the
float.h include, so we never noticed this variable was mispelled in the
past.

This should provide a noticeable speed boost when saving certain types
of databases with many sorted sets inside.
上级 ed2a691a
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <math.h> #include <math.h>
#include <unistd.h> #include <unistd.h>
#include <sys/time.h> #include <sys/time.h>
#include <float.h>
#include "util.h" #include "util.h"
...@@ -319,7 +320,7 @@ int d2string(char *buf, size_t len, double value) { ...@@ -319,7 +320,7 @@ int d2string(char *buf, size_t len, double value) {
* integer printing function that is much faster. */ * integer printing function that is much faster. */
double min = -4503599627370495; /* (2^52)-1 */ double min = -4503599627370495; /* (2^52)-1 */
double max = 4503599627370496; /* -(2^52) */ double max = 4503599627370496; /* -(2^52) */
if (val > min && val < max && value == ((double)((long long)value))) if (value > min && value < max && value == ((double)((long long)value)))
len = ll2string(buf,len,(long long)value); len = ll2string(buf,len,(long long)value);
else else
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册