From 30177af92c3a5dea483d291b5f6dfd4c74b87101 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Thu, 13 Jul 2023 14:40:42 -0700 Subject: [PATCH] sysprof: fix gte boundary for binary search to slice --- src/sysprof/sysprof-time-filter-model.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sysprof/sysprof-time-filter-model.c b/src/sysprof/sysprof-time-filter-model.c index 3ae91911..959ee133 100644 --- a/src/sysprof/sysprof-time-filter-model.c +++ b/src/sysprof/sysprof-time-filter-model.c @@ -281,9 +281,8 @@ binary_search_gte (GListModel *model, last = g_list_model_get_item (model, hi); if (value > sysprof_document_frame_get_time (first)) - return lo; - - if (value < sysprof_document_frame_get_time (last)) + return lo + 1; + else if (value < sysprof_document_frame_get_time (last)) return hi - 1; return GTK_INVALID_LIST_POSITION;