Do not duplicate code.

This commit is contained in:
Bartosz Taudul 2022-07-20 01:06:12 +02:00
parent a04f830962
commit f52ac31468
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -20,11 +20,7 @@ static tracy_force_inline char* CopyString( const char* src, size_t sz )
static tracy_force_inline char* CopyString( const char* src ) static tracy_force_inline char* CopyString( const char* src )
{ {
const auto sz = strlen( src ); return CopyString( src, strlen( src ) );
auto dst = (char*)tracy_malloc( sz + 1 );
memcpy( dst, src, sz );
dst[sz] = '\0';
return dst;
} }
static tracy_force_inline char* CopyStringFast( const char* src, size_t sz ) static tracy_force_inline char* CopyStringFast( const char* src, size_t sz )
@ -37,11 +33,7 @@ static tracy_force_inline char* CopyStringFast( const char* src, size_t sz )
static tracy_force_inline char* CopyStringFast( const char* src ) static tracy_force_inline char* CopyStringFast( const char* src )
{ {
const auto sz = strlen( src ); return CopyStringFast( src, strlen( src ) );
auto dst = (char*)tracy_malloc_fast( sz + 1 );
memcpy( dst, src, sz );
dst[sz] = '\0';
return dst;
} }
} }