From e0dade9253bb54762fb6c25e1eed8c4294691ab8 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Fri, 1 Mar 2019 16:27:24 -0500 Subject: [PATCH] Fix: lib: stop auto-seeking when getting the first satisfying message 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 --- lib/graph/iterator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/graph/iterator.c b/lib/graph/iterator.c index 834a0b76..ef627e3a 100644 --- a/lib/graph/iterator.c +++ b/lib/graph/iterator.c @@ -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; -- 2.34.1