mirror of
https://github.com/wolfpld/tracy
synced 2025-05-07 15:33:52 +00:00
Style fixes.
This commit is contained in:
parent
8fb6c0dfcb
commit
053932249c
@ -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 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user