From Sean Parent: 'No Naked For Loops'; ie, whenever possible try to use algorithms.
Looks like we are trying to use a rotate here, so create a vector of indices, a vector of positions, then rotate the positions.  Accomplishes the same thing and is a little clearer.