- while (cit != deplist.end()) {
- if (OnlyFilename(cit->first) == filename) {
- // Can't erase the current iterator, but we can increment and then erase.
- // deplist is a map so only the erased iterator is invalidated.
+ DepList::iterator end = deplist.end();
+ while (cit != end) {
+ if (onlyFilename(cit->first) == filename) {
+ // Can't erase the current iterator, but we
+ // can increment and then erase.
+ // deplist is a map so only the erased
+ // iterator is invalidated.