1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-23 15:16:17 +00:00

Merge pull request #72288 from MewPurPur/use-string-repeat

Use `String.repeat()` to optimize several String methods
This commit is contained in:
Clay John
2023-05-05 09:56:48 -07:00
committed by GitHub
12 changed files with 37 additions and 94 deletions

View File

@@ -1372,10 +1372,7 @@ static void _write_string(Ref<FileAccess> f, int p_tablevel, const String &p_str
if (p_string.is_empty()) {
return;
}
String tab;
for (int i = 0; i < p_tablevel; i++) {
tab += "\t";
}
String tab = String("\t").repeat(p_tablevel);
f->store_string(tab + p_string + "\n");
}