mirror of
https://github.com/fluencelabs/redis
synced 2025-03-25 03:41:04 +00:00
modify compare function to check if the encoding is equal before comparing
This commit is contained in:
parent
a5456b2cb6
commit
d593c48869
10
ziplist.c
10
ziplist.c
@ -461,12 +461,12 @@ unsigned int ziplistCompare(unsigned char *p, unsigned char *s, unsigned int sle
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
/* Try to compare encoded values */
|
||||||
if (zipTryEncoding(s,&sval,&sencoding)) {
|
if (zipTryEncoding(s,&sval,&sencoding)) {
|
||||||
/* Do integer compare */
|
if (entry.encoding == sencoding) {
|
||||||
val = zipLoadInteger(p+entry.headersize,entry.encoding);
|
val = zipLoadInteger(p+entry.headersize,entry.encoding);
|
||||||
return val == sval;
|
return val == sval;
|
||||||
} else {
|
}
|
||||||
/* Ziplist entry is integer encoded, but given entry is not. */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user