[ox/std] Fix Result::moveTo to not move if error
This commit is contained in:
parent
1a8f2ce69d
commit
f8f5b059ed
2
deps/ox/src/ox/std/error.hpp
vendored
2
deps/ox/src/ox/std/error.hpp
vendored
@ -174,7 +174,9 @@ struct [[nodiscard]] Result {
|
|||||||
}
|
}
|
||||||
|
|
||||||
constexpr Error moveTo(type *val) noexcept {
|
constexpr Error moveTo(type *val) noexcept {
|
||||||
|
if (!error) [[likely]] {
|
||||||
*val = std::move(value);
|
*val = std::move(value);
|
||||||
|
}
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user