mirror of
https://github.com/fluencelabs/redis
synced 2025-06-15 10:11:21 +00:00
BITCOUNT/BITPOS fixed to work with LZF encoded objects.
This commit is contained in:
@ -458,6 +458,7 @@ void bitcountCommand(redisClient *c) {
|
|||||||
|
|
||||||
/* Set the 'p' pointer to the string, that can be just a stack allocated
|
/* Set the 'p' pointer to the string, that can be just a stack allocated
|
||||||
* array if our string was integer encoded. */
|
* array if our string was integer encoded. */
|
||||||
|
if (lzfEncodedObject(o)) o = dbUnshareStringValue(c->db,c->argv[1],o);
|
||||||
if (o->encoding == REDIS_ENCODING_INT) {
|
if (o->encoding == REDIS_ENCODING_INT) {
|
||||||
p = (unsigned char*) llbuf;
|
p = (unsigned char*) llbuf;
|
||||||
strlen = ll2string(llbuf,sizeof(llbuf),(long)o->ptr);
|
strlen = ll2string(llbuf,sizeof(llbuf),(long)o->ptr);
|
||||||
@ -527,6 +528,7 @@ void bitposCommand(redisClient *c) {
|
|||||||
|
|
||||||
/* Set the 'p' pointer to the string, that can be just a stack allocated
|
/* Set the 'p' pointer to the string, that can be just a stack allocated
|
||||||
* array if our string was integer encoded. */
|
* array if our string was integer encoded. */
|
||||||
|
if (lzfEncodedObject(o)) o = dbUnshareStringValue(c->db,c->argv[1],o);
|
||||||
if (o->encoding == REDIS_ENCODING_INT) {
|
if (o->encoding == REDIS_ENCODING_INT) {
|
||||||
p = (unsigned char*) llbuf;
|
p = (unsigned char*) llbuf;
|
||||||
strlen = ll2string(llbuf,sizeof(llbuf),(long)o->ptr);
|
strlen = ll2string(llbuf,sizeof(llbuf),(long)o->ptr);
|
||||||
|
Reference in New Issue
Block a user