Skip to content

Commit

Permalink
sparse_set: drop swap_at as it ought to be
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Aug 31, 2023
1 parent 8d6bc63 commit 94a131f
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/entt/entity/sparse_set.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,22 +227,6 @@ class basic_sparse_set {
/*! @brief Random access iterator type. */
using basic_iterator = internal::sparse_set_iterator<packed_container_type>;

/**
* @brief Swaps two items at specific locations.
* @param lhs A position to move from.
* @param rhs The other position to move from.
*/
void swap_at(const std::size_t lhs, const std::size_t rhs) {
const auto entity = static_cast<typename traits_type::entity_type>(lhs);
const auto other = static_cast<typename traits_type::entity_type>(rhs);

sparse_ref(packed[lhs]) = traits_type::combine(other, traits_type::to_integral(packed[lhs]));
sparse_ref(packed[rhs]) = traits_type::combine(entity, traits_type::to_integral(packed[rhs]));

using std::swap;
swap(packed[lhs], packed[rhs]);
}

/**
* @brief Erases an entity from a sparse set.
* @param it An iterator to the element to pop.
Expand Down

0 comments on commit 94a131f

Please sign in to comment.