Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Mar 4, 2018
1 parent 7bf550a commit c1cada4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ Dell XPS 13 out of the mid 2014):
| Benchmark | EntityX (compile-time) | EnTT |
|-----------|-------------|-------------|
| Create 1M entities | 0.0167s | **0.0076s** |
| Destroy 1M entities | 0.0053s | **0.0031s** |
| Create 1M entities | 0.0167s | **0.0046s** |
| Destroy 1M entities | 0.0053s | **0.0022s** |
| Standard view, 1M entities, one component | 0.0012s | **1.9e-07s** |
| Standard view, 1M entities, two components | **0.0012s** | 0.0013s |
| Standard view, 1M entities, two components<br/>Half of the entities have all the components | 0.0009s | **0.0007s** |
Expand Down
2 changes: 1 addition & 1 deletion src/entt/entity/registry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ class Registry {
void destroy(entity_type entity) {
assert(valid(entity));
const auto entt = entity & traits_type::entity_mask;
const auto version = (entity & (~traits_type::entity_mask)) + (typename traits_type::entity_type{1} << traits_type::entity_shift);
const auto version = (((entity >> traits_type::entity_shift) + 1) & traits_type::version_mask) << traits_type::entity_shift;
const auto node = (available ? next : ((entt + 1) & traits_type::entity_mask)) | version;

entities[entt] = node;
Expand Down
2 changes: 1 addition & 1 deletion src/entt/entity/sparse_set.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ class SparseSet<Entity, Type>: public SparseSet<Entity> {
std::enable_if_t<!std::is_constructible<Type, Args...>::value, object_type &>
construct(entity_type entity, Args&&... args) {
underlying_type::construct(entity);
instances.emplace_back(Type{ std::forward<Args>(args)... });
instances.emplace_back(Type{std::forward<Args>(args)...});
return instances.back();
}

Expand Down

0 comments on commit c1cada4

Please sign in to comment.