Engine: don't grow the string buffer

Just switch the format string instead, avoids reallocs.
This commit is contained in:
Kawe Mazidjatari 2025-02-09 00:52:32 +01:00
parent 7607ca073f
commit e223cec9c2

View File

@ -247,12 +247,7 @@ void NET_PrintFunc(const char* fmt, ...)
result = FormatV(fmt, args); result = FormatV(fmt, args);
va_end(args); va_end(args);
if (result.back() != '\n') Msg(context, result.back() == '\n' ? "%s" : "%s\n", result.c_str());
{
result.push_back('\n');
}
Msg(context, "%s", result.c_str());
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------