mirror of
https://github.com/fluencelabs/redis
synced 2025-03-21 01:50:50 +00:00
use the entry struct in zipRawEntryLength
This commit is contained in:
parent
03e52931dd
commit
bb57b965c4
10
ziplist.c
10
ziplist.c
@ -209,14 +209,10 @@ static zlentry zipEntry(unsigned char *p) {
|
|||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the total amount used by an entry (encoded length + payload). */
|
/* Return the total number of bytes used by the entry at "p". */
|
||||||
static unsigned int zipRawEntryLength(unsigned char *p) {
|
static unsigned int zipRawEntryLength(unsigned char *p) {
|
||||||
unsigned int prevlensize, lensize, len;
|
zlentry e = zipEntry(p);
|
||||||
/* Byte-size of encoded length of previous entry */
|
return e.headersize + e.len;
|
||||||
zipDecodeLength(p,&prevlensize);
|
|
||||||
/* Encoded length of this entry's payload */
|
|
||||||
len = zipDecodeLength(p+prevlensize, &lensize);
|
|
||||||
return prevlensize+lensize+len;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a new empty ziplist. */
|
/* Create a new empty ziplist. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user