The 'f' variable is used only in the ADD, BACK, DEL, ENTER, JOIN, and REPLACE undo/redo cases. So, avoid making a somewhat costly call when it is entirely superfluous. Rearrange the undo types to make checking for the above six types easier.