Jelajahi Sumber

organizer: cleanup/remove dependency from <algorithm>

Michele Caini 3 tahun lalu
induk
melakukan
c3f230956c
1 mengubah file dengan 6 tambahan dan 4 penghapusan
  1. 6 4
      src/entt/entity/organizer.hpp

+ 6 - 4
src/entt/entity/organizer.hpp

@@ -1,12 +1,10 @@
 #ifndef ENTT_ENTITY_ORGANIZER_HPP
 #define ENTT_ENTITY_ORGANIZER_HPP
 
-#include <algorithm>
 #include <cstddef>
 #include <type_traits>
 #include <utility>
 #include <vector>
-#include "../container/dense_map.hpp"
 #include "../core/type_info.hpp"
 #include "../core/type_traits.hpp"
 #include "../core/utility.hpp"
@@ -145,8 +143,12 @@ class basic_organizer final {
             return {};
         } else {
             const type_info *info[sizeof...(Type)]{&type_id<Type>()...};
-            const auto length = (std::min)(count, sizeof...(Type));
-            std::copy_n(info, length, buffer);
+            const auto length = count < sizeof...(Type) ? count : sizeof...(Type);
+
+            for(std::size_t pos{}; pos < length; ++pos) {
+                buffer[pos] = info[pos];
+            }
+
             return length;
         }
     }