diff --git a/src/vt/topos/location/manager.impl.h b/src/vt/topos/location/manager.impl.h index 8b1d908cc3..43d17748dc 100644 --- a/src/vt/topos/location/manager.impl.h +++ b/src/vt/topos/location/manager.impl.h @@ -79,8 +79,8 @@ LocationManager::makeCollectionLM(VirtualProxyType proxy) { template void LocationManager::destroyCollectionLM(VirtualProxyType proxy) { - if (auto it = collection_lms.find(proxy); it != collection_lms.end()) { - objgroup::proxy::Proxy> lm_proxy(it->second); + if (auto elm = collection_lms.extract(proxy); elm) { + objgroup::proxy::Proxy> lm_proxy(elm.mapped()); lm_proxy.destroyCollective(); } else { vtAbort("Could not find location manager for proxy");