While there convert iterator loops to range-based. Differential Revision: https://reviews.llvm.org/D78275