Преглед на файлове

registry: avoid code duplication

Michele Caini преди 4 години
родител
ревизия
c37c35b52b
променени са 1 файла, в които са добавени 1 реда и са изтрити 2 реда
  1. 1 2
      src/entt/entity/registry.hpp

+ 1 - 2
src/entt/entity/registry.hpp

@@ -865,8 +865,7 @@ public:
      */
     template<typename Component, typename... Args>
     decltype(auto) replace(const entity_type entity, Args &&...args) {
-        ENTT_ASSERT(valid(entity), "Invalid entity");
-        return assure<Component>().patch(entity, [&args...](auto &...curr) { ((curr = Component{std::forward<Args>(args)...}), ...); });
+        return patch<Component>(entity, [&args...](auto &...curr) { ((curr = Component{std::forward<Args>(args)...}), ...); });
     }
 
     /**