Do not allocate vector each time format string legacy is called

This commit is contained in:
Ted John authored and GitHub committed 2021-01-02 11:27:50 +01:00
1 parent ad52abf39a
commit b0e57c0ca9
1 file changed
+2 -1
+2 -1
View File
@@ -808,7 +808,8 @@ namespace OpenRCT2
size_t FormatStringLegacy(char* buffer, size_t bufferLen, rct_string_id id, const void* args)
{
std::vector<FormatArg_t> anyArgs;
thread_local std::vector<FormatArg_t> anyArgs;
anyArgs.clear();
auto fmt = GetFmtStringById(id);
BuildAnyArgListFromLegacyArgBuffer(fmt, anyArgs, args);
return FormatStringAny(buffer, bufferLen, fmt, anyArgs);