[ox/std] Fix Result::moveTo to not move if error

This commit is contained in:
Gary Talent 2022-07-24 01:22:40 -05:00
parent 1a8f2ce69d
commit f8f5b059ed

View File

@ -174,7 +174,9 @@ struct [[nodiscard]] Result {
}
constexpr Error moveTo(type *val) noexcept {
*val = std::move(value);
if (!error) [[likely]] {
*val = std::move(value);
}
return error;
}