瀏覽代碼

meta: minor changes

Michele Caini 3 年之前
父節點
當前提交
c34c5da277
共有 1 個文件被更改,包括 2 次插入10 次删除
  1. 2 10
      src/entt/meta/meta.hpp

+ 2 - 10
src/entt/meta/meta.hpp

@@ -1337,11 +1337,7 @@ public:
      */
     [[nodiscard]] meta_any construct(meta_any *const args, const size_type sz) const {
         if(node.details) {
-            const auto *candidate = lookup(args, sz, false, [first = node.details->ctor.cbegin(), last = node.details->ctor.cend()]() mutable {
-                return first == last ? nullptr : &(first++)->second;
-            });
-
-            if(candidate) {
+            if(const auto *candidate = lookup(args, sz, false, [first = node.details->ctor.cbegin(), last = node.details->ctor.cend()]() mutable { return first == last ? nullptr : &(first++)->second; }); candidate) {
                 return candidate->invoke(*ctx, args);
             }
         }
@@ -1399,11 +1395,7 @@ public:
     meta_any invoke(const id_type id, meta_handle instance, meta_any *const args, const size_type sz) const {
         if(node.details) {
             if(auto it = node.details->func.find(id); it != node.details->func.cend()) {
-                const auto *candidate = lookup(args, sz, (instance->data() == nullptr), [curr = &it->second]() mutable {
-                    return curr ? std::exchange(curr, curr->next.get()) : nullptr;
-                });
-
-                if(candidate) {
+                if(const auto *candidate = lookup(args, sz, (instance->data() == nullptr), [curr = &it->second]() mutable { return curr ? std::exchange(curr, curr->next.get()) : nullptr; }); candidate) {
                     return candidate->invoke(*ctx, std::move(instance), args);
                 }
             }