Skip to content

Commit

Permalink
any: avoid else after return
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Oct 4, 2024
1 parent f39c687 commit cc79817
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/entt/core/any.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,9 @@ class basic_any {
if(vtable && mode != any_policy::cref && *info == *other.info) {
if(auto *val = other.data(); val) {
return (vtable(operation::transfer, *this, val) != nullptr);
} else {
return (vtable(operation::assign, *this, std::as_const(other).data()) != nullptr);
}

return (vtable(operation::assign, *this, std::as_const(other).data()) != nullptr);
}

return false;
Expand Down Expand Up @@ -453,9 +453,9 @@ template<typename Type, std::size_t Len, std::size_t Align>
if constexpr(std::is_copy_constructible_v<std::remove_cv_t<std::remove_reference_t<Type>>>) {
if(auto *const instance = any_cast<std::remove_reference_t<Type>>(&data); instance) {
return static_cast<Type>(std::move(*instance));
} else {
return any_cast<Type>(data);
}

return any_cast<Type>(data);
} else {
auto *const instance = any_cast<std::remove_reference_t<Type>>(&data);
ENTT_ASSERT(instance, "Invalid instance");
Expand Down

0 comments on commit cc79817

Please sign in to comment.