mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Avoid executing strlen() twice in assert-enabled builds.
This commit is contained in:
parent
507b5e3a46
commit
91bb392678
@ -44,7 +44,11 @@ static inline char* CopyString( const char* src, size_t sz )
|
|||||||
|
|
||||||
static inline char* CopyString( const char* src )
|
static inline char* CopyString( const char* src )
|
||||||
{
|
{
|
||||||
return CopyString( src, strlen( src ) );
|
const auto sz = strlen( src );
|
||||||
|
auto dst = (char*)tracy_malloc( sz + 1 );
|
||||||
|
memcpy( dst, src, sz );
|
||||||
|
dst[sz] = '\0';
|
||||||
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user