mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Preserve groups order.
This commit is contained in:
parent
6b3165d3cc
commit
6358b4588d
@ -9202,7 +9202,7 @@ void View::DrawFindZone()
|
|||||||
auto it = m_findZone.groups.find( gid );
|
auto it = m_findZone.groups.find( gid );
|
||||||
if( it == m_findZone.groups.end() )
|
if( it == m_findZone.groups.end() )
|
||||||
{
|
{
|
||||||
it = m_findZone.groups.emplace( gid, FindZone::Group {} ).first;
|
it = m_findZone.groups.emplace( gid, FindZone::Group { m_findZone.groupId++ } ).first;
|
||||||
it->second.zones.reserve( 1024 );
|
it->second.zones.reserve( 1024 );
|
||||||
}
|
}
|
||||||
FindZone::Group* group = &it->second;
|
FindZone::Group* group = &it->second;
|
||||||
@ -9222,6 +9222,7 @@ void View::DrawFindZone()
|
|||||||
switch( m_findZone.sortBy )
|
switch( m_findZone.sortBy )
|
||||||
{
|
{
|
||||||
case FindZone::SortBy::Order:
|
case FindZone::SortBy::Order:
|
||||||
|
pdqsort_branchless( groups.begin(), groups.end(), []( const auto& lhs, const auto& rhs ) { return lhs->second.id < rhs->second.id; } );
|
||||||
break;
|
break;
|
||||||
case FindZone::SortBy::Count:
|
case FindZone::SortBy::Count:
|
||||||
pdqsort_branchless( groups.begin(), groups.end(), []( const auto& lhs, const auto& rhs ) { return lhs->second.zones.size() > rhs->second.zones.size(); } );
|
pdqsort_branchless( groups.begin(), groups.end(), []( const auto& lhs, const auto& rhs ) { return lhs->second.zones.size() > rhs->second.zones.size(); } );
|
||||||
|
@ -407,6 +407,7 @@ private:
|
|||||||
|
|
||||||
struct Group
|
struct Group
|
||||||
{
|
{
|
||||||
|
uint16_t id;
|
||||||
Vector<short_ptr<ZoneEvent>> zones;
|
Vector<short_ptr<ZoneEvent>> zones;
|
||||||
int64_t time = 0;
|
int64_t time = 0;
|
||||||
};
|
};
|
||||||
@ -416,6 +417,7 @@ private:
|
|||||||
std::vector<int16_t> match;
|
std::vector<int16_t> match;
|
||||||
std::map<uint64_t, Group> groups;
|
std::map<uint64_t, Group> groups;
|
||||||
size_t processed;
|
size_t processed;
|
||||||
|
uint16_t groupId;
|
||||||
int selMatch = 0;
|
int selMatch = 0;
|
||||||
uint64_t selGroup = Unselected;
|
uint64_t selGroup = Unselected;
|
||||||
char pattern[1024] = {};
|
char pattern[1024] = {};
|
||||||
@ -480,6 +482,7 @@ private:
|
|||||||
ResetSelection();
|
ResetSelection();
|
||||||
groups.clear();
|
groups.clear();
|
||||||
processed = 0;
|
processed = 0;
|
||||||
|
groupId = 0;
|
||||||
selCs = 0;
|
selCs = 0;
|
||||||
selGroup = Unselected;
|
selGroup = Unselected;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user