You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Clean up some uses of String::substr
Cases where the end position is either equvalent to the default or past the end of the string.
This commit is contained in:
@@ -2112,7 +2112,7 @@ String CodeEdit::get_text_for_code_completion() const {
|
||||
completion_text += line.substr(0, get_caret_column());
|
||||
/* Not unicode, represents the caret. */
|
||||
completion_text += String::chr(0xFFFF);
|
||||
completion_text += line.substr(get_caret_column(), line.size());
|
||||
completion_text += line.substr(get_caret_column());
|
||||
} else {
|
||||
completion_text += line;
|
||||
}
|
||||
@@ -2411,7 +2411,7 @@ String CodeEdit::get_text_with_cursor_char(int p_line, int p_column) const {
|
||||
result += line_text.substr(0, p_column);
|
||||
/* Not unicode, represents the cursor. */
|
||||
result += String::chr(0xFFFF);
|
||||
result += line_text.substr(p_column, line_text.size());
|
||||
result += line_text.substr(p_column);
|
||||
} else {
|
||||
result += line_text;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user