Just use auto in two places.

This commit is contained in:
John Ericson 2020-10-17 21:47:52 +00:00
parent e6f8ae56d8
commit 57d0432b39

View file

@ -90,10 +90,10 @@ template<typename G>
static void removeGoal(std::shared_ptr<G> goal, std::map<StorePath, std::weak_ptr<G>> & goalMap) static void removeGoal(std::shared_ptr<G> goal, std::map<StorePath, std::weak_ptr<G>> & goalMap)
{ {
/* !!! inefficient */ /* !!! inefficient */
for (typename std::map<StorePath, std::weak_ptr<G>>::iterator i = goalMap.begin(); for (auto i = goalMap.begin();
i != goalMap.end(); ) i != goalMap.end(); )
if (i->second.lock() == goal) { if (i->second.lock() == goal) {
typename std::map<StorePath, std::weak_ptr<G>>::iterator j = i; ++j; auto j = i; ++j;
goalMap.erase(i); goalMap.erase(i);
i = j; i = j;
} }