Ver Fonte

meta: remove unnecessary checks

skypjack há 6 meses atrás
pai
commit
b4b85c8d53
1 ficheiros alterados com 3 adições e 3 exclusões
  1. 3 3
      src/entt/meta/meta.hpp

+ 3 - 3
src/entt/meta/meta.hpp

@@ -865,7 +865,7 @@ struct meta_data {
     template<typename Type>
     template<typename Type>
     // NOLINTNEXTLINE(modernize-use-nodiscard)
     // NOLINTNEXTLINE(modernize-use-nodiscard)
     bool set(meta_handle instance, Type &&value) const {
     bool set(meta_handle instance, Type &&value) const {
-        return (node->set != nullptr) && node->set(meta_handle{*ctx, std::move(instance)}, meta_any{*ctx, std::forward<Type>(value)});
+        return node->set(meta_handle{*ctx, std::move(instance)}, meta_any{*ctx, std::forward<Type>(value)});
     }
     }
 
 
     /**
     /**
@@ -874,7 +874,7 @@ struct meta_data {
      * @return A wrapper containing the value of the underlying variable.
      * @return A wrapper containing the value of the underlying variable.
      */
      */
     [[nodiscard]] meta_any get(meta_handle instance) const {
     [[nodiscard]] meta_any get(meta_handle instance) const {
-        return (node->get != nullptr) ? node->get(meta_handle{*ctx, std::move(instance)}) : meta_any{meta_ctx_arg, *ctx};
+        return node->get(meta_handle{*ctx, std::move(instance)});
     }
     }
 
 
     /**
     /**
@@ -1004,7 +1004,7 @@ struct meta_func {
      * @return A wrapper containing the returned value, if any.
      * @return A wrapper containing the returned value, if any.
      */
      */
     meta_any invoke(meta_handle instance, meta_any *const args, const size_type sz) const {
     meta_any invoke(meta_handle instance, meta_any *const args, const size_type sz) const {
-        return ((node->invoke != nullptr) && (sz == arity())) ? node->invoke(meta_handle{*ctx, std::move(instance)}, args) : meta_any{meta_ctx_arg, *ctx};
+        return (sz == arity()) ? node->invoke(meta_handle{*ctx, std::move(instance)}, args) : meta_any{meta_ctx_arg, *ctx};
     }
     }
 
 
     /**
     /**