Kaynağa Gözat

*: suppress a couple of warnings (shadow/unused)

Michele Caini 4 yıl önce
ebeveyn
işleme
18d02a0c95
2 değiştirilmiş dosya ile 5 ekleme ve 5 silme
  1. 1 1
      src/entt/entity/registry.hpp
  2. 4 4
      src/entt/entity/storage.hpp

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

@@ -1442,7 +1442,7 @@ public:
             cpool->sort(std::move(compare), std::move(algo), std::forward<Args>(args)...);
         } else {
             if constexpr(std::is_invocable_v<Compare, decltype(cpool->get({})), decltype(cpool->get({}))>) {
-                cpool->sort([this, cpool, compare = std::move(compare)](const auto lhs, const auto rhs) {
+                cpool->sort([cpool, compare = std::move(compare)](const auto lhs, const auto rhs) {
                     return compare(std::as_const(cpool->get(lhs)), std::as_const(cpool->get(rhs)));
                 }, std::move(algo), std::forward<Args>(args)...);
             } else {

+ 4 - 4
src/entt/entity/storage.hpp

@@ -204,12 +204,12 @@ class basic_storage: public basic_sparse_set<Entity, typename std::allocator_tra
             std::uninitialized_value_construct(mem + len, mem + sz);
 
             ENTT_TRY {
-                for(auto pos = len; pos < sz; ++pos) {
-                    mem[pos] = alloc_traits::allocate(allocator, packed_page);
+                for(auto next = len; next < sz; ++next) {
+                    mem[next] = alloc_traits::allocate(allocator, packed_page);
                 }
             } ENTT_CATCH {
-                for(auto pos = len; pos < sz && mem[pos]; ++pos) {
-                    alloc_traits::deallocate(allocator, mem[pos], packed_page);
+                for(auto next = len; next < sz && mem[next]; ++next) {
+                    alloc_traits::deallocate(allocator, mem[next], packed_page);
                 }
 
                 std::destroy(mem + len, mem + sz);