Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Sep 16, 2019
1 parent 8f9d8e1 commit e216fa9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/entt/entity/registry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,23 +166,23 @@ class basic_registry {
&& ((std::is_same_v<Component, Get> || std::get<pool_type<Get> *>(cpools)->has(entt)) && ...)
&& !(std::get<pool_type<Exclude> *>(cpools)->has(entt) || ...))
{
const auto pos = this->owned++;
const auto pos = owned++;
(std::get<pool_type<Owned> *>(cpools)->swap(std::get<pool_type<Owned> *>(cpools)->data()[pos], entt), ...);
}
} else if constexpr(std::disjunction_v<std::is_same<Exclude, Component>...>) {
if((std::get<pool_type<Owned> *>(cpools)->has(entt) && ...)
&& (std::get<pool_type<Get> *>(cpools)->has(entt) && ...)
&& ((std::is_same_v<Exclude, Component> || !std::get<pool_type<Exclude> *>(cpools)->has(entt)) && ...))
{
const auto pos = this->owned++;
const auto pos = owned++;
(std::get<pool_type<Owned> *>(cpools)->swap(std::get<pool_type<Owned> *>(cpools)->data()[pos], entt), ...);
}
}
}

void discard_if(const Entity entt) {
if(std::get<0>(cpools)->has(entt) && std::get<0>(cpools)->index(entt) < this->owned) {
const auto pos = --this->owned;
if(std::get<0>(cpools)->has(entt) && std::get<0>(cpools)->index(entt) < owned) {
const auto pos = --owned;
(std::get<pool_type<Owned> *>(cpools)->swap(std::get<pool_type<Owned> *>(cpools)->data()[pos], entt), ...);
}
}
Expand Down Expand Up @@ -1414,7 +1414,6 @@ class basic_registry {
curr->set.construct(entity);
} else {
const auto pos = curr->owned++;
// useless this-> used to suppress a warning with clang
(std::get<pool_type<Owned> *>(cpools)->swap(std::get<pool_type<Owned> *>(cpools)->data()[pos], entity), ...);
}
}
Expand Down

0 comments on commit e216fa9

Please sign in to comment.