summaryrefslogtreecommitdiff
path: root/src/t_stream.c
diff options
context:
space:
mode:
authorZhaolongLi <0x4f4f4f4f@gmail.com>2021-06-24 20:08:26 +0800
committerGitHub <noreply@github.com>2021-06-24 15:08:26 +0300
commit89ae353748cffc50dbb0222529fa765e156f2951 (patch)
tree245ed4c835763f624e4a6bef5ef63715ff1f51ca /src/t_stream.c
parenta5bc54f01eb90699945421df938814c193681780 (diff)
downloadredis-89ae353748cffc50dbb0222529fa765e156f2951.tar.gz
change streamAppendItem to use raxEOF instead of raxNext (#9138)
The call to raxNext didn't really progress in the rax, since we were already on the last item. instead, all it does is check that it is indeed a valid item, so the new code clearer.
Diffstat (limited to 'src/t_stream.c')
-rw-r--r--src/t_stream.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/t_stream.c b/src/t_stream.c
index 68836bf15..ceb4950e1 100644
--- a/src/t_stream.c
+++ b/src/t_stream.c
@@ -458,8 +458,8 @@ int streamAppendItem(stream *s, robj **argv, int64_t numfields, streamID *added_
size_t lp_bytes = 0; /* Total bytes in the tail listpack. */
unsigned char *lp = NULL; /* Tail listpack pointer. */
- /* Get a reference to the tail node listpack. */
- if (raxNext(&ri)) {
+ if (!raxEOF(&ri)) {
+ /* Get a reference to the tail node listpack. */
lp = ri.data;
lp_bytes = lpBytes(lp);
}