diff options
author | Timothy Flynn <trflynn89@pm.me> | 2023-02-09 13:26:53 -0500 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-02-10 09:08:52 +0000 |
commit | 4a916cd3796cef0ef10374fcf9a602c96e226e6c (patch) | |
tree | 8794ceaaad624514796fba84e0a79e3a407079fc /Userland/Utilities/keymap.cpp | |
parent | 52687814ea8f80ea2a0f38af0902e4223a0a76b9 (diff) | |
download | serenity-4a916cd3796cef0ef10374fcf9a602c96e226e6c.zip |
Everywhere: Remove needless copies of Error / ErrorOr instances
Either take the underlying objects with release_* methods or move() the
instances around.
Diffstat (limited to 'Userland/Utilities/keymap.cpp')
-rw-r--r-- | Userland/Utilities/keymap.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Userland/Utilities/keymap.cpp b/Userland/Utilities/keymap.cpp index 25629ad1a7..3b03cd7ede 100644 --- a/Userland/Utilities/keymap.cpp +++ b/Userland/Utilities/keymap.cpp @@ -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(); } } |