From d56786ccd8dc6761d28e7ef0f4d6732c9a1d0c77 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 23 Aug 2019 19:04:53 +0200 Subject: [PATCH] TextEditor: Avoid an unnecessary whole-file copy when opening something This was left over from before we had the StringView(const ByteBuffer&) constructor to help us. --- Applications/TextEditor/TextEditorWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Applications/TextEditor/TextEditorWidget.cpp b/Applications/TextEditor/TextEditorWidget.cpp index c92106f080..e316e1de78 100644 --- a/Applications/TextEditor/TextEditorWidget.cpp +++ b/Applications/TextEditor/TextEditorWidget.cpp @@ -199,6 +199,6 @@ void TextEditorWidget::open_sesame(const String& path) GMessageBox::show(String::format("Opening \"%s\" failed: %s", path.characters(), strerror(errno)), "Error", GMessageBox::Type::Error, GMessageBox::InputType::OK, window()); } - m_editor->set_text(String::copy(file.read_all())); + m_editor->set_text(file.read_all()); set_path(FileSystemPath(path)); }