snapshot: drop redundant checks and avoid unnecessary lookups

This commit is contained in:
Michele Caini
2023-03-24 16:48:30 +01:00
parent bda52701f5
commit f907bc066a

View File

@@ -373,12 +373,10 @@ class basic_continuous_loader {
template<typename Component>
void remove_if_exists() {
for(auto &&ref: remloc) {
const auto local = ref.second.first;
auto &storage = reg->template storage<Component>();
if(reg->valid(local)) {
reg->template remove<Component>(local);
}
for(auto &&ref: remloc) {
storage.remove(ref.second.first);
}
}