1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-07 15:33:52 +00:00

Style fixes.

This commit is contained in:
Bartosz Taudul 2019-02-08 02:29:24 +01:00
parent 8fb6c0dfcb
commit 053932249c

View File

@ -5689,38 +5689,39 @@ void View::DrawFindZone()
Vector<ZoneEvent*>* zonesToIterate = &v->second.zones;
Vector<ZoneEvent*> sortedZones;
if ( m_findZone.tableSortBy != FindZone::TableSortBy::Starttime )
if( m_findZone.tableSortBy != FindZone::TableSortBy::Starttime )
{
zonesToIterate = &sortedZones;
sortedZones.reserve_and_use( v->second.zones.size() );
memcpy(sortedZones.data(), v->second.zones.data(), sizeof(ZoneEvent*)*v->second.zones.size());
memcpy( sortedZones.data(), v->second.zones.data(), v->second.zones.size() * sizeof( ZoneEvent* ) );
switch( m_findZone.tableSortBy )
{
case FindZone::TableSortBy::Runtime:
if( m_findZone.selfTime )
pdqsort_branchless( sortedZones.begin(), sortedZones.end(), [this]( const auto& lhs, const auto& rhs )
{
return (m_worker.GetZoneEndDirect( *lhs ) - lhs->start - GetZoneChildTimeFast( *lhs ))
>
(m_worker.GetZoneEndDirect( *rhs ) - rhs->start - GetZoneChildTimeFast( *rhs ));
} );
{
pdqsort_branchless( sortedZones.begin(), sortedZones.end(), [this]( const auto& lhs, const auto& rhs ) {
return m_worker.GetZoneEndDirect( *lhs ) - lhs->start - GetZoneChildTimeFast( *lhs ) >
m_worker.GetZoneEndDirect( *rhs ) - rhs->start - GetZoneChildTimeFast( *rhs );
} );
}
else
pdqsort_branchless( sortedZones.begin(), sortedZones.end(), [this]( const auto& lhs, const auto& rhs ) { return (m_worker.GetZoneEndDirect( *lhs ) - lhs->start) > (m_worker.GetZoneEndDirect( *rhs ) - rhs->start); } );
{
pdqsort_branchless( sortedZones.begin(), sortedZones.end(), [this]( const auto& lhs, const auto& rhs ) {
return m_worker.GetZoneEndDirect( *lhs ) - lhs->start > m_worker.GetZoneEndDirect( *rhs ) - rhs->start;
} );
}
break;
case FindZone::TableSortBy::Name:
pdqsort_branchless( sortedZones.begin(), sortedZones.end(), [this]( const auto& lhs, const auto& rhs )
{
if (lhs->name.active != rhs->name.active) return lhs->name.active > rhs->name.active;
return strcmp(m_worker.GetString( lhs->name ), m_worker.GetString( rhs->name )) < 0;
} );
pdqsort_branchless( sortedZones.begin(), sortedZones.end(), [this]( const auto& lhs, const auto& rhs ) {
if( lhs->name.active != rhs->name.active ) return lhs->name.active > rhs->name.active;
return strcmp( m_worker.GetString( lhs->name ), m_worker.GetString( rhs->name ) ) < 0;
} );
break;
default:
assert( false );
break;
}
}
for( auto& ev : *zonesToIterate )