`temparray` goes out of scope after this block, but is still used afterwards (`oldarray`).