mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
Merge branch 'issue_218' of git://github.com/pietern/redis
This commit is contained in:
commit
5727b9aa94
22
redis.c
22
redis.c
@ -2602,6 +2602,21 @@ static void addReplyLong(redisClient *c, long l) {
|
|||||||
addReplySds(c,sdsnewlen(buf,len));
|
addReplySds(c,sdsnewlen(buf,len));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void addReplyLongLong(redisClient *c, long long ll) {
|
||||||
|
char buf[128];
|
||||||
|
size_t len;
|
||||||
|
|
||||||
|
if (ll == 0) {
|
||||||
|
addReply(c,shared.czero);
|
||||||
|
return;
|
||||||
|
} else if (ll == 1) {
|
||||||
|
addReply(c,shared.cone);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
len = snprintf(buf,sizeof(buf),":%lld\r\n",ll);
|
||||||
|
addReplySds(c,sdsnewlen(buf,len));
|
||||||
|
}
|
||||||
|
|
||||||
static void addReplyUlong(redisClient *c, unsigned long ul) {
|
static void addReplyUlong(redisClient *c, unsigned long ul) {
|
||||||
char buf[128];
|
char buf[128];
|
||||||
size_t len;
|
size_t len;
|
||||||
@ -6038,10 +6053,7 @@ static void hincrbyCommand(redisClient *c) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
robj *o_incr = getDecodedObject(c->argv[3]);
|
incr = strtoll(c->argv[3]->ptr, NULL, 10);
|
||||||
incr = strtoll(o_incr->ptr, NULL, 10);
|
|
||||||
decrRefCount(o_incr);
|
|
||||||
|
|
||||||
if (o->encoding == REDIS_ENCODING_ZIPMAP) {
|
if (o->encoding == REDIS_ENCODING_ZIPMAP) {
|
||||||
unsigned char *zm = o->ptr;
|
unsigned char *zm = o->ptr;
|
||||||
unsigned char *zval;
|
unsigned char *zval;
|
||||||
@ -6092,7 +6104,7 @@ static void hincrbyCommand(redisClient *c) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
server.dirty++;
|
server.dirty++;
|
||||||
addReplyLong(c, value);
|
addReplyLongLong(c, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hgetCommand(redisClient *c) {
|
static void hgetCommand(redisClient *c) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user