diff options
Diffstat (limited to 'src/StringUtils.cpp')
-rw-r--r-- | src/StringUtils.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/StringUtils.cpp b/src/StringUtils.cpp index fc19decb3..e6fbcc6fe 100644 --- a/src/StringUtils.cpp +++ b/src/StringUtils.cpp @@ -52,34 +52,34 @@ static unsigned char HexToDec(char a_HexChar) -AString & vPrintf(AString & str, const char * format, fmt::printf_args args) +AString & vPrintf(AString & a_String, const char * a_Format, fmt::printf_args a_ArgList) { - ASSERT(format != nullptr); - fmt::memory_buffer Buffer; - fmt::vprintf(Buffer, fmt::to_string_view(format), args); - str.assign(Buffer.data(), Buffer.size()); - return str; + ASSERT(a_Format != nullptr); + fmt::memory_buffer Buffer; // Save a string allocation compared to vsprintf + fmt::vprintf(Buffer, fmt::to_string_view(a_Format), a_ArgList); + a_String.assign(Buffer.data(), Buffer.size()); + return a_String; } -AString vPrintf(const char * format, fmt::printf_args args) +AString vPrintf(const char * a_Format, fmt::printf_args a_ArgList) { - ASSERT(format != nullptr); - return fmt::vsprintf(format, args); + ASSERT(a_Format != nullptr); + return fmt::vsprintf(a_Format, a_ArgList); } -AString & vAppendPrintf(AString & a_String, const char * format, fmt::printf_args args) +AString & vAppendPrintf(AString & a_String, const char * a_Format, fmt::printf_args a_ArgList) { - ASSERT(format != nullptr); + ASSERT(a_Format != nullptr); fmt::memory_buffer Buffer; - fmt::vprintf(Buffer, fmt::to_string_view(format), args); + fmt::vprintf(Buffer, fmt::to_string_view(a_Format), a_ArgList); a_String.append(Buffer.data(), Buffer.size()); return a_String; } |