mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-29 22:42:52 +00:00
Everywhere: Remove needless copies of Error / ErrorOr instances
Either take the underlying objects with release_* methods or move() the instances around.
This commit is contained in:
parent
52687814ea
commit
4a916cd379
Notes:
sideshowbarker
2024-07-17 03:03:15 +09:00
Author: https://github.com/trflynn89
Commit: 4a916cd379
Pull-request: https://github.com/SerenityOS/serenity/pull/17399
Reviewed-by: https://github.com/linusg
28 changed files with 69 additions and 77 deletions
|
@ -27,9 +27,8 @@ bool KeyboardMapperWidget::request_close()
|
|||
return true;
|
||||
auto result = GUI::MessageBox::ask_about_unsaved_changes(window(), m_filename);
|
||||
if (result == GUI::MessageBox::ExecResult::Yes) {
|
||||
ErrorOr<void> error_or = save();
|
||||
if (error_or.is_error())
|
||||
show_error_to_user(error_or.error());
|
||||
if (auto error_or = save(); error_or.is_error())
|
||||
show_error_to_user(error_or.release_error());
|
||||
|
||||
if (!window()->is_modified())
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue