diff options
| author | Ulf Hermann <ulf.hermann@digia.com> | 2014-09-25 15:26:56 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@digia.com> | 2014-09-29 13:10:44 +0200 |
| commit | 16ebc76277e180c81184d240c93cb3305a70c8fc (patch) | |
| tree | 5e4d065090c90fcea38a5a16f914d689b835c85b | |
| parent | 34372ecde4a3d9794be9b92c5321849acf10cd28 (diff) | |
| download | qt-creator-16ebc76277e180c81184d240c93cb3305a70c8fc.tar.gz | |
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>
| -rw-r--r-- | src/plugins/qmlprofiler/sortedtimelinemodel.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/qmlprofiler/sortedtimelinemodel.h b/src/plugins/qmlprofiler/sortedtimelinemodel.h index a5ec6ecbe9..f6bae537fd 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); |
