Commit 16ebc762 authored by Ulf Hermann's avatar Ulf Hermann
Browse files

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: default avatarKai Koehne <kai.koehne@digia.com>
parent 34372ecd
......@@ -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);
......
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