Swap value function arrays instead of reallocating them

This brings the relative runtime (compared to your master) to 0.89 or so on my machine.
I think it's just as efficient to do:

    a, b = b, a

(it gets lowered to the same thing, without need for a temp variable.)