diff --git a/src/entt/entity/snapshot.hpp b/src/entt/entity/snapshot.hpp index db0f8b804..fce650f0f 100644 --- a/src/entt/entity/snapshot.hpp +++ b/src/entt/entity/snapshot.hpp @@ -373,12 +373,10 @@ class basic_continuous_loader { template void remove_if_exists() { - for(auto &&ref: remloc) { - const auto local = ref.second.first; + auto &storage = reg->template storage(); - if(reg->valid(local)) { - reg->template remove(local); - } + for(auto &&ref: remloc) { + storage.remove(ref.second.first); } }