mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-25 15:34:36 +00:00
Use strlen instead of pointer walking in the rest of places.
This commit is contained in:
parent
9f0f3a7218
commit
be40c1e38e
@ -901,8 +901,7 @@ char* NormalizePath( const char* path )
|
||||
if( path[0] != '/' ) return nullptr;
|
||||
|
||||
const char* ptr = path;
|
||||
const char* end = path;
|
||||
while( *end ) end++;
|
||||
const char* end = path + strlen( path );
|
||||
|
||||
char* res = (char*)tracy_malloc( end - ptr + 1 );
|
||||
size_t rsz = 0;
|
||||
|
@ -3638,14 +3638,12 @@ void Worker::AddSourceLocationPayload( const char* data, size_t sz )
|
||||
memcpy( &color, data, 4 );
|
||||
memcpy( &line, data + 4, 4 );
|
||||
data += 8;
|
||||
auto end = data;
|
||||
auto end = data + strlen( data );
|
||||
|
||||
while( *end ) end++;
|
||||
const auto func = StoreString( data, end - data );
|
||||
end++;
|
||||
|
||||
data = end;
|
||||
while( *end ) end++;
|
||||
data = end + strlen( data );
|
||||
const auto source = StoreString( data, end - data );
|
||||
end++;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user