1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-01 13:13:53 +00:00

Remove a level of indirection.

This commit is contained in:
Bartosz Taudul 2017-11-19 16:27:23 +01:00
parent 08b8c6ec1b
commit ff35f2960a
2 changed files with 6 additions and 6 deletions

View File

@ -660,7 +660,7 @@ void View::ProcessZoneEnd( const QueueZoneEnd& ev )
auto tit = m_threadMap.find( ev.thread );
assert( tit != m_threadMap.end() );
auto td = m_threads[tit->second];
auto td = tit->second;
auto& stack = td->stack;
assert( !stack.empty() );
auto zone = stack.back();
@ -686,7 +686,7 @@ void View::ProcessZoneText( const QueueZoneText& ev )
auto tit = m_threadMap.find( ev.thread );
assert( tit != m_threadMap.end() );
auto td = m_threads[tit->second];
auto td = tit->second;
auto& stack = td->stack;
assert( !stack.empty() );
auto zone = stack.back();
@ -1095,18 +1095,18 @@ ThreadData* View::NoticeThread( uint64_t thread )
if( it == m_threadMap.end() )
{
CheckThreadString( thread );
m_threadMap.emplace( thread, (uint32_t)m_threads.size() );
auto td = m_slab.AllocInit<ThreadData>();
td->id = thread;
td->count = 0;
td->showFull = true;
td->visible = true;
m_threads.push_back( td );
return m_threads.back();
m_threadMap.emplace( thread, td );
return td;
}
else
{
return m_threads[it->second];
return it->second;
}
}

View File

@ -188,7 +188,7 @@ private:
flat_hash_set<uint64_t, power_of_two_std_hash<uint64_t>> m_pendingThreads;
flat_hash_set<uint64_t, power_of_two_std_hash<uint64_t>> m_pendingSourceLocation;
flat_hash_map<uint64_t, StringLocation, power_of_two_std_hash<uint64_t>> m_pendingCustomStrings;
flat_hash_map<uint64_t, uint32_t, power_of_two_std_hash<uint64_t>> m_threadMap;
flat_hash_map<uint64_t, ThreadData*, power_of_two_std_hash<uint64_t>> m_threadMap;
flat_hash_map<uint16_t, uint32_t, power_of_two_std_hash<uint16_t>> m_gpuCtxMap;
flat_hash_map<uint64_t, uint32_t, power_of_two_std_hash<uint64_t>> m_plotMap;
std::unordered_map<const char*, uint32_t, charutil::Hasher, charutil::Comparator> m_plotRev;