Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
bb57b965
Commit
bb57b965
authored
May 29, 2010
by
Pieter Noordhuis
Browse files
use the entry struct in zipRawEntryLength
parent
03e52931
Changes
1
Show whitespace changes
Inline
Side-by-side
ziplist.c
View file @
bb57b965
...
...
@@ -209,14 +209,10 @@ static zlentry zipEntry(unsigned char *p) {
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
)
{
unsigned
int
prevlensize
,
lensize
,
len
;
/* Byte-size of encoded length of previous entry */
zipDecodeLength
(
p
,
&
prevlensize
);
/* Encoded length of this entry's payload */
len
=
zipDecodeLength
(
p
+
prevlensize
,
&
lensize
);
return
prevlensize
+
lensize
+
len
;
zlentry
e
=
zipEntry
(
p
);
return
e
.
headersize
+
e
.
len
;
}
/* Create a new empty ziplist. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment