mirror of
https://github.com/wolfpld/tracy
synced 2025-05-08 07:53:52 +00:00
No need to inject string terminator.
Comparison in m_data.stringMap already takes string size into account, as an charutil::StringKey optimization.
This commit is contained in:
parent
dfad9695d2
commit
4a4fe82a1b
@ -3345,8 +3345,6 @@ void Worker::HandlePostponedPlots()
|
||||
StringLocation Worker::StoreString( char* str, size_t sz )
|
||||
{
|
||||
StringLocation ret;
|
||||
const char backup = str[sz];
|
||||
str[sz] = '\0';
|
||||
charutil::StringKey key = { str, sz };
|
||||
auto sit = m_data.stringMap.find( key );
|
||||
if( sit == m_data.stringMap.end() )
|
||||
@ -3364,7 +3362,6 @@ StringLocation Worker::StoreString( char* str, size_t sz )
|
||||
ret.ptr = sit->first.ptr;
|
||||
ret.idx = sit->second;
|
||||
}
|
||||
str[sz] = backup;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user