summaryrefslogtreecommitdiffstats
path: root/editor
diff options
context:
space:
mode:
authorEric M <itsjusteza@gmail.com>2020-08-17 15:52:42 +1000
committerEric M <itsjusteza@gmail.com>2021-05-04 16:21:33 +1000
commit77fd9e4dd332e01e1f6df8eaa3446ffb5aa46798 (patch)
tree452892ed9b9248dd481c86731d305e5f594647eb /editor
parent3de4181bd8acac0b192ed9d5b6625b0184619e01 (diff)
downloadredot-engine-77fd9e4dd332e01e1f6df8eaa3446ffb5aa46798.tar.gz
Improve output log performance.
Added method to create a new line in RichTextLabel without adding an ItemNewline to the previous line. Previously, removing a line then adding a newline was adding unnecessary ItemNewline instances to the previous line, significantly the remove_line method.
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_log.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp
index 858ef92502..3957f981be 100644
--- a/editor/editor_log.cpp
+++ b/editor/editor_log.cpp
@@ -122,12 +122,7 @@ void EditorLog::_process_message(const String &p_msg, MessageType p_type) {
LogMessage &previous = messages.write[messages.size() - 1];
previous.count++;
- if (collapse) {
- // Remove last line if collapsing, as it will be replace by the next added line with an updated count.
- log->remove_line(log->get_line_count() - 1);
- }
-
- _add_log_line(previous);
+ _add_log_line(previous, collapse);
} else {
// Different message to the previous one received.
LogMessage message(p_msg, p_type);