sds: don't check for impossible string size in 32 bit systems.

This commit is contained in:
antirez 2016-09-01 11:04:22 +02:00
parent e0d4146620
commit 9f76d82689

View File

@ -35,6 +35,7 @@
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include <limits.h>
#include "sds.h"
#include "sdsalloc.h"
@ -61,8 +62,10 @@ static inline char sdsReqType(size_t string_size) {
return SDS_TYPE_8;
if (string_size < 1<<16)
return SDS_TYPE_16;
#if (LONG_MAX == LLONG_MAX)
if (string_size < 1ll<<32)
return SDS_TYPE_32;
#endif
return SDS_TYPE_64;
}