diff options
author | VolTer <mew.pur.pur@abv.bg> | 2023-01-29 00:52:05 +0100 |
---|---|---|
committer | VolTer <mew.pur.pur@abv.bg> | 2023-05-01 02:27:46 +0200 |
commit | 6b84e258d20e007fd7c95ac2d4f9244bd93edc13 (patch) | |
tree | a99fd73bfdd933775b157122956fe4fbbe656389 /modules/gdscript/gdscript_editor.cpp | |
parent | 10d22a4b35b33ad89f626c261ef7f1aeae81daf3 (diff) | |
download | redot-engine-6b84e258d20e007fd7c95ac2d4f9244bd93edc13.tar.gz |
Use String.repeat() in more places
Diffstat (limited to 'modules/gdscript/gdscript_editor.cpp')
-rw-r--r-- | modules/gdscript/gdscript_editor.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 3fc0924b4c..6c9e09d4d8 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -3040,12 +3040,7 @@ String GDScriptLanguage::_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 @@ -3092,12 +3087,7 @@ void GDScriptLanguage::auto_indent_code(String &p_code, int p_from_line, int p_t } if (i >= p_from_line) { - l = ""; - for (int j = 0; j < indent_stack.size(); j++) { - l += indent; - } - l += st; - + l = indent.repeat(indent_stack.size()) + st; } else if (i > p_to_line) { break; } |