mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Do not allocate vector each time format string legacy is called
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user