1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

Merge pull request #11943 from xokdvium/dev/registry-remove-use-erase

refactor(libfetchers/registry): use standard remove_if + erase
This commit is contained in:
Jörg Thalheim 2024-11-24 10:43:42 +01:00 committed by GitHub
commit fb6e37b834
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -94,12 +94,9 @@ void Registry::add(
void Registry::remove(const Input & input)
{
// FIXME: use C++20 std::erase.
for (auto i = entries.begin(); i != entries.end(); )
if (i->from == input)
i = entries.erase(i);
else
++i;
entries.erase(
std::remove_if(entries.begin(), entries.end(), [&](const Entry & entry) { return entry.from == input; }),
entries.end());
}
static Path getSystemRegistryPath()