mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02: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:
committed by
Linus Groh
parent
52687814ea
commit
4a916cd379
Notes:
sideshowbarker
2024-07-17 03:03:15 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/4a916cd379 Pull-request: https://github.com/SerenityOS/serenity/pull/17399 Reviewed-by: https://github.com/linusg
@@ -47,7 +47,7 @@ ErrorOr<NonnullRefPtr<ConfigFile>> ConfigFile::open(DeprecatedString const& file
|
||||
// the same as if we had opened an empty file. This behavior is a little weird, but is required by
|
||||
// user code, which does not check the config file exists before opening.
|
||||
if (!(allow_altering == AllowWriting::No && maybe_file.error().code() == ENOENT))
|
||||
return maybe_file.error();
|
||||
return maybe_file.release_error();
|
||||
} else {
|
||||
buffered_file = TRY(Stream::BufferedFile::create(maybe_file.release_value()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user