mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 06:17:35 +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
28 changed files with 69 additions and 77 deletions
|
@ -65,10 +65,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
// Verify that all specified keymaps are loadable
|
||||
for (auto& keymap_name : mappings_vector) {
|
||||
auto keymap = Keyboard::CharacterMap::load_from_file(keymap_name);
|
||||
if (keymap.is_error()) {
|
||||
if (auto keymap = Keyboard::CharacterMap::load_from_file(keymap_name); keymap.is_error()) {
|
||||
warnln("Cannot load keymap {}: {}({})", keymap_name, keymap.error().string_literal(), keymap.error().code());
|
||||
return keymap.error();
|
||||
return keymap.release_error();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue