1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:28:11 +00:00

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.
This commit is contained in:
Andreas Kling 2019-08-23 19:04:53 +02:00
parent 5768b384b9
commit d56786ccd8

View file

@ -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));
}