Browse Source

minor changes - code coverage

Michele Caini 6 years ago
parent
commit
da2b6acf91
1 changed files with 2 additions and 3 deletions
  1. 2 3
      src/entt/entity/registry.hpp

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

@@ -71,10 +71,9 @@ class basic_registry {
         template<typename... Args>
         decltype(auto) assign(basic_registry &registry, const Entity entt, Args &&... args) {
             if constexpr(std::is_empty_v<Component>) {
-                Component component{std::forward<Args>(args)...};
                 storage<Entity, Component>::construct(entt);
-                construction.publish(entt, registry, std::as_const(component));
-                return component;
+                construction.publish(entt, registry, Component{std::forward<Args>(args)...});
+                return Component{};
             } else {
                 auto &component = storage<Entity, Component>::construct(entt, std::forward<Args>(args)...);
                 construction.publish(entt, registry, component);