I saw that ;-) The translation is:
do {
to.set((from = from.shift(1)).get(-1));
} while(--count > 0);
which looks correct to me. Hence my question what orodley thinks is wrong.