Identifier: Fix cppcheck warning.
cppcheck was warning about vector iterators being invalidated in a loop. The warning was actually bogus since the iterators were immediately refetched, but the affected code can anyway be written better in terms of remove_if.