diff options
author | Clay John <claynjohn@gmail.com> | 2023-05-05 09:56:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-05 09:56:48 -0700 |
commit | 610877e32651ecc10d1f530def7576b8d0429a28 (patch) | |
tree | ad98207d1ff2a1ad052327b68987662f09e496bb /modules/mono/csharp_script.cpp | |
parent | 214a848e0fc5208b747f2f5ed6d0894084b7414e (diff) | |
parent | 6b84e258d20e007fd7c95ac2d4f9244bd93edc13 (diff) | |
download | redot-engine-610877e32651ecc10d1f530def7576b8d0429a28.tar.gz |
Merge pull request #72288 from MewPurPur/use-string-repeat
Use `String.repeat()` to optimize several String methods
Diffstat (limited to 'modules/mono/csharp_script.cpp')
-rw-r--r-- | modules/mono/csharp_script.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index a77b1d83ad..0d6436594e 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -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 |