forked from qt-creator/qt-creator
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 <kai.koehne@digia.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user