Use SmallVectorImpl::iterator/const_iterator instead of SmallVector
to avoid specifying the vector size.