mirror of
https://github.com/fluencelabs/redis
synced 2025-03-23 02:50:50 +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;
|
||||
}
|
||||
} else {
|
||||
/* Try to compare encoded values */
|
||||
if (zipTryEncoding(s,&sval,&sencoding)) {
|
||||
/* Do integer compare */
|
||||
val = zipLoadInteger(p+entry.headersize,entry.encoding);
|
||||
return val == sval;
|
||||
} else {
|
||||
/* Ziplist entry is integer encoded, but given entry is not. */
|
||||
if (entry.encoding == sencoding) {
|
||||
val = zipLoadInteger(p+entry.headersize,entry.encoding);
|
||||
return val == sval;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user