Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf.pld@gmail.com>2019-08-16 00:01:25 +0300
committerBartosz Taudul <wolf.pld@gmail.com>2019-08-16 00:03:37 +0300
commite90ddf7ee549cfc5aeac3ead20088faef0a8d03a (patch)
tree70a49547169c6557b13b9dbcaccc9e51a717f99a /server/TracyView.cpp
parentc22c259a13c2bdbb859bd2317c28f71ffb5fa843 (diff)
Don't search whole data set twice.
Diffstat (limited to 'server/TracyView.cpp')
-rw-r--r--server/TracyView.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/server/TracyView.cpp b/server/TracyView.cpp
index 99603e2a..dab0028a 100644
--- a/server/TracyView.cpp
+++ b/server/TracyView.cpp
@@ -4852,12 +4852,11 @@ void View::DrawZoneInfoWindow()
{
const auto thread = m_worker.CompressThread( tid );
- // TODO: use ait, fit as begin for aend, fend search
auto ait = std::lower_bound( mem.data.begin(), mem.data.end(), ev.Start(), [] ( const auto& l, const auto& r ) { return l.TimeAlloc() < r; } );
- const auto aend = std::upper_bound( mem.data.begin(), mem.data.end(), end, [] ( const auto& l, const auto& r ) { return l < r.TimeAlloc(); } );
+ const auto aend = std::upper_bound( ait, mem.data.end(), end, [] ( const auto& l, const auto& r ) { return l < r.TimeAlloc(); } );
auto fit = std::lower_bound( mem.frees.begin(), mem.frees.end(), ev.Start(), [&mem] ( const auto& l, const auto& r ) { return mem.data[l].TimeFree() < r; } );
- const auto fend = std::upper_bound( mem.frees.begin(), mem.frees.end(), end, [&mem] ( const auto& l, const auto& r ) { return l < mem.data[r].TimeFree(); } );
+ const auto fend = std::upper_bound( fit, mem.frees.end(), end, [&mem] ( const auto& l, const auto& r ) { return l < mem.data[r].TimeFree(); } );
const auto aDist = std::distance( ait, aend );
const auto fDist = std::distance( fit, fend );