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
commit 610877e326
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 37 additions and 94 deletions

View file

@ -522,12 +522,7 @@ String CSharpLanguage::_get_indentation() const {
if (use_space_indentation) {
int indent_size = EDITOR_GET("text_editor/behavior/indent/size");
String space_indent = "";
for (int i = 0; i < indent_size; i++) {
space_indent += " ";
}
return space_indent;
return String(" ").repeat(indent_size);
}
}
#endif