Rewrite refeed for more performance.

The current version performs a bit better, I expected the compilers to
unroll the loop but they did not. Interestingly GCC gives better code
than Clang LLVM on this version.