Browse Source

sparse_set: trick the linter about adjacent parameters

Michele Caini 1 year ago
parent
commit
22683f843a
1 changed files with 6 additions and 6 deletions
  1. 6 6
      src/entt/entity/sparse_set.hpp

+ 6 - 6
src/entt/entity/sparse_set.hpp

@@ -215,14 +215,14 @@ class basic_sparse_set {
         }
     }
 
-    void swap_at(const std::size_t from, const std::size_t to) {
-        auto &lhs = packed[from];
-        auto &rhs = packed[to];
+    void swap_at(const std::size_t lhs, const std::size_t rhs) {
+        auto &from = packed[lhs];
+        auto &to = packed[rhs];
 
-        sparse_ref(lhs) = traits_type::combine(static_cast<typename traits_type::entity_type>(to), traits_type::to_integral(lhs));
-        sparse_ref(rhs) = traits_type::combine(static_cast<typename traits_type::entity_type>(from), traits_type::to_integral(rhs));
+        sparse_ref(from) = traits_type::combine(static_cast<typename traits_type::entity_type>(rhs), traits_type::to_integral(from));
+        sparse_ref(to) = traits_type::combine(static_cast<typename traits_type::entity_type>(lhs), traits_type::to_integral(to));
 
-        std::swap(lhs, rhs);
+        std::swap(from, to);
     }
 
 private: