mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Don't search whole data set twice.
This commit is contained in:
parent
c22c259a13
commit
e90ddf7ee5
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user