From 9c39256a28eff24e16ca373a02729e775e37d05a Mon Sep 17 00:00:00 2001 From: wutao_water <253041022@qq.com> Date: Mon, 2 May 2022 17:46:48 +0800 Subject: [PATCH] cleanup: use ZIPLIST_ENTRY_END macro instead of 1 (#3672) update macros ZIPLIST_ENTRY_END i think the right definition is ((zl)+intrev32ifbe(ZIPLIST_BYTES(zl))-ZIPLIST_END_SIZE) --- src/ziplist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ziplist.c b/src/ziplist.c index fa73cbf6f..36556050c 100644 --- a/src/ziplist.c +++ b/src/ziplist.c @@ -255,7 +255,7 @@ /* Return the pointer to the last byte of a ziplist, which is, the * end of ziplist FF entry. */ -#define ZIPLIST_ENTRY_END(zl) ((zl)+intrev32ifbe(ZIPLIST_BYTES(zl))-1) +#define ZIPLIST_ENTRY_END(zl) ((zl)+intrev32ifbe(ZIPLIST_BYTES(zl))-ZIPLIST_END_SIZE) /* Increment the number of items field in the ziplist header. Note that this * macro should never overflow the unsigned 16 bit integer, since entries are