1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

StringIdx search from string.

This commit is contained in:
Bartosz Taudul
2020-04-02 02:08:00 +02:00
parent 387fdb30b0
commit e7f4f58886
2 changed files with 15 additions and 0 deletions
+14
View File
@@ -2379,6 +2379,20 @@ int64_t Worker::GetZoneEnd( const GpuEvent& ev )
}
}
uint32_t Worker::FindStringIdx( const char* str ) const
{
charutil::StringKey key = { str, strlen( str ) };
auto sit = m_data.stringMap.find( key );
if( sit == m_data.stringMap.end() )
{
return 0;
}
else
{
return sit->second;
}
}
const char* Worker::GetString( uint64_t ptr ) const
{
const auto it = m_data.strings.find( ptr );