@skypjack suggested that I open an issue for a question on this line:
When available is 0, the index portion of the next entity is currently set to the old index + 1.
It doesn't really matter what this value is set to, as long as it's not equal to the index, since the node won't be visited anyway in this case and the meaning of the value here is purely used to manually check if a given entity is dead or alive.
Since it doesn't matter, it would be a little nicer and faster if null were used instead since it's a constant.
I used null to initialize next and removed the check on available. Therefore this:
const auto node = (available ? to_integer(next) : ((entt + 1) & traits_type::entity_mask)) | version;
Now looks like this:
const auto node = to_integer(next) | version;
Deleting entities should be even slightly faster as a consequence. :+1:
Thank you for pointing this out.
Most helpful comment
I used
nullto initializenextand removed the check onavailable. Therefore this:Now looks like this:
Deleting entities should be even slightly faster as a consequence. :+1:
Thank you for pointing this out.