Ver Fonte

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.
Andreas Kling há 5 anos atrás
pai
commit
d56786ccd8
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      Applications/TextEditor/TextEditorWidget.cpp

+ 1 - 1
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));
 }