From 16ebc76277e180c81184d240c93cb3305a70c8fc Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 25 Sep 2014 15:26:56 +0200 Subject: [PATCH] QmlProfiler: fix finding of first/last events in SortedTimelineModel SortedTimelineModel's find methods were off by one if the given time was exactly the start or end time of the first or last element. Change-Id: I34e7813af5a32f1a9f9b8af9c17f970e68b5e58f Reviewed-by: Kai Koehne --- src/plugins/qmlprofiler/sortedtimelinemodel.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmlprofiler/sortedtimelinemodel.h b/src/plugins/qmlprofiler/sortedtimelinemodel.h index a5ec6ecbe91..f6bae537fdc 100644 --- a/src/plugins/qmlprofiler/sortedtimelinemodel.h +++ b/src/plugins/qmlprofiler/sortedtimelinemodel.h @@ -86,7 +86,7 @@ public: // in the "endtime" list, find the first event that ends after startTime if (endTimes.isEmpty()) return -1; - if (endTimes.count() == 1 || endTimes.first().end >= startTime) + if (endTimes.count() == 1 || endTimes.first().end > startTime) return endTimes.first().startIndex; if (endTimes.last().end <= startTime) return -1; @@ -101,7 +101,7 @@ public: return -1; if (ranges.count() == 1) return 0; - if (ranges.last().start <= endTime) + if (ranges.last().start < endTime) return ranges.count() - 1; return lowerBound(ranges, endTime);