Commit 0484dbcf authored by dejun.xdj's avatar dejun.xdj
Browse files

Streams: using streamCompareID() instead of direct compare.

parent ab33bcd3
...@@ -1392,9 +1392,7 @@ void xreadCommand(client *c) { ...@@ -1392,9 +1392,7 @@ void xreadCommand(client *c) {
* synchronously in case the group top item delivered is smaller * synchronously in case the group top item delivered is smaller
* than what the stream has inside. */ * than what the stream has inside. */
streamID *last = &groups[i]->last_id; streamID *last = &groups[i]->last_id;
if (s->last_id.ms > last->ms || if (streamCompareID(&s->last_id, last) > 0) {
(s->last_id.ms == last->ms && s->last_id.seq > last->seq))
{
serve_synchronously = 1; serve_synchronously = 1;
*gt = *last; *gt = *last;
} }
...@@ -1402,9 +1400,7 @@ void xreadCommand(client *c) { ...@@ -1402,9 +1400,7 @@ void xreadCommand(client *c) {
} else { } else {
/* For consumers without a group, we serve synchronously if we can /* For consumers without a group, we serve synchronously if we can
* actually provide at least one item from the stream. */ * actually provide at least one item from the stream. */
if (s->last_id.ms > gt->ms || if (streamCompareID(&s->last_id, gt) > 0) {
(s->last_id.ms == gt->ms && s->last_id.seq > gt->seq))
{
serve_synchronously = 1; serve_synchronously = 1;
} }
} }
......
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