Fix: lib: stop auto-seeking when getting the first satisfying message
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 1 Mar 2019 21:27:24 +0000 (16:27 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:38 +0000 (18:19 -0400)
find_message_ge_ns_from_origin() did push all the remaining messages
when getting the first message >= the requested seeking time, but then
it was continuing its "next" loop.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
lib/graph/iterator.c

index 834a0b76f70818df85d8be0d8123abdd48d1c708..ef627e3a1884f1f4c78ac9195c6756116641a05b 100644 (file)
@@ -1206,7 +1206,7 @@ enum bt_message_iterator_status find_message_ge_ns_from_origin(
 
        BT_ASSERT(iterator->methods.next);
 
-       while (true) {
+       while (!got_first) {
                /*
                 * Call the user's "next" method to get the next
                 * messages and status.
@@ -1253,7 +1253,7 @@ enum bt_message_iterator_status find_message_ge_ns_from_origin(
                        status = auto_seek_handle_message(iterator,
                                ns_from_origin, messages[i], &got_first);
                        if (status == BT_MESSAGE_ITERATOR_STATUS_OK) {
-                               /* Message was either put or moved */
+                               /* Message was either pushed or moved */
                                messages[i] = NULL;
                        } else {
                                goto end;
This page took 0.02555 seconds and 4 git commands to generate.