Codechange: Use StringBuilder to create encoded strings.

This commit is contained in:
frosch
2025-04-04 20:08:25 +02:00
committed by frosch
parent 128e0fcde2
commit dd073eb38d
4 changed files with 44 additions and 48 deletions

View File

@@ -12,6 +12,7 @@
#include "script_object.hpp"
#include "../../strings_func.h"
#include "../../core/string_builder.hpp"
#include <variant>
@@ -141,7 +142,7 @@ private:
ParamCheck(StringIndexInTab owner, int idx, Param *param) : owner(owner), idx(idx), param(param) {}
void Encode(std::back_insert_iterator<std::string> &output, std::string_view cmd);
void Encode(StringBuilder &output, std::string_view cmd);
};
using ParamList = std::vector<ParamCheck>;
@@ -168,7 +169,7 @@ private:
* @param args The parameters to be consumed.
* @param first Whether it's the first call in the recursion.
*/
void _GetEncodedText(std::back_insert_iterator<std::string> &output, int &param_count, ParamSpan args, bool first);
void _GetEncodedText(StringBuilder &output, int &param_count, ParamSpan args, bool first);
/**
* Set a parameter, where the value is the first item on the stack.