You're right, but this is really non-obvious code.  I guess it'll be clearer if the comment regarding copying from temp was updated to make it clear what is going on.