summaryrefslogtreecommitdiff
path: root/ziplist.c
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2010-05-31 20:18:23 +0200
committerPieter Noordhuis <pcnoordhuis@gmail.com>2010-05-31 20:18:35 +0200
commit6a8e35ad9252f1ea1ff0a449af52aef1f71815f8 (patch)
tree41f8e20acaabf8f57296a45aa72a1d55cc1fd245 /ziplist.c
parent8632fb30401ccc6824b84499602fba7052cc3346 (diff)
downloadredis-6a8e35ad9252f1ea1ff0a449af52aef1f71815f8.tar.gz
ziplistDelete no longer needs a direction now ziplistPrev is fixed
Diffstat (limited to 'ziplist.c')
-rw-r--r--ziplist.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/ziplist.c b/ziplist.c
index 2aeffa41f..dd94f14e0 100644
--- a/ziplist.c
+++ b/ziplist.c
@@ -482,7 +482,7 @@ unsigned char *ziplistInsert(unsigned char *zl, unsigned char *p, char *s, unsig
/* Delete a single entry from the ziplist, pointed to by *p.
* Also update *p in place, to be able to iterate over the
* ziplist, while deleting entries. */
-unsigned char *ziplistDelete(unsigned char *zl, unsigned char **p, int direction) {
+unsigned char *ziplistDelete(unsigned char *zl, unsigned char **p) {
unsigned int offset = *p-zl;
zl = __ziplistDelete(zl,*p,1);
@@ -490,11 +490,7 @@ unsigned char *ziplistDelete(unsigned char *zl, unsigned char **p, int direction
* do a realloc which might result in a different "zl"-pointer.
* When the delete direction is back to front, we might delete the last
* entry and end up with "p" pointing to ZIP_END, so check this. */
- if (*(zl+offset) == ZIP_END && direction == ZIPLIST_HEAD) {
- *p = ZIPLIST_ENTRY_TAIL(zl);
- } else {
- *p = zl+offset;
- }
+ *p = zl+offset;
return zl;
}