Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Sep 7, 2019
1 parent ab94ffb commit 79dc8ff
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/entt/meta/factory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,11 @@ class meta_factory {

template<typename Node>
bool duplicate(const ENTT_ID_TYPE identifier, const Node *node) ENTT_NOEXCEPT {
return node ? node->identifier == identifier || duplicate(identifier, node->next) : false;
return node && (node->identifier == identifier || duplicate(identifier, node->next));
}

bool duplicate(const meta_any &key, const internal::meta_prop_node *node) ENTT_NOEXCEPT {
return node ? node->key() == key || duplicate(key, node->next) : false;
return node && (node->key() == key || duplicate(key, node->next));
}

template<typename>
Expand Down Expand Up @@ -563,9 +563,13 @@ class meta_factory {
&internal::meta_info<Type>::template dtor<Func>,
type,
[](meta_handle handle) {
return handle.type() == internal::meta_info<Type>::resolve()->meta()
? (std::invoke(Func, *handle.data<Type>()), true)
: false;
const auto valid = (handle.type() == internal::meta_info<Type>::resolve()->meta());

if(valid) {
std::invoke(Func, *handle.data<Type>());
}

return valid;
},
[]() ENTT_NOEXCEPT -> meta_dtor {
return &node;
Expand Down

0 comments on commit 79dc8ff

Please sign in to comment.