diff options
Diffstat (limited to 'bpkg/rep-remove.cxx')
-rw-r--r-- | bpkg/rep-remove.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/bpkg/rep-remove.cxx b/bpkg/rep-remove.cxx index f161c71..fafe5a8 100644 --- a/bpkg/rep-remove.cxx +++ b/bpkg/rep-remove.cxx @@ -82,13 +82,12 @@ namespace bpkg const shared_ptr<available_package>& p (rp); vector<package_location>& ls (p->locations); - for (auto i (ls.cbegin ()), e (ls.cend ()); i != e; ++i) + for (auto i (ls.cbegin ()); i != ls.cend (); ) { if (i->repository.object_id () == name) - { - ls.erase (i); - break; - } + i = ls.erase (i); + else + ++i; } if (ls.empty ()) |