Unverified Commit 89ae3537 authored by ZhaolongLi's avatar ZhaolongLi Committed by GitHub
Browse files

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.
parent a5bc54f0
...@@ -458,8 +458,8 @@ int streamAppendItem(stream *s, robj **argv, int64_t numfields, streamID *added_ ...@@ -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. */ size_t lp_bytes = 0; /* Total bytes in the tail listpack. */
unsigned char *lp = NULL; /* Tail listpack pointer. */ unsigned char *lp = NULL; /* Tail listpack pointer. */
/* Get a reference to the tail node listpack. */ if (!raxEOF(&ri)) {
if (raxNext(&ri)) { /* Get a reference to the tail node listpack. */
lp = ri.data; lp = ri.data;
lp_bytes = lpBytes(lp); lp_bytes = lpBytes(lp);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment