Instead of looking up a predecessor or successor to the current map entry, when that entry has been seen already, keep the already-looked-up value in a variable and use that instead of looking it up again.
Define a standard naming convention for map entry iterators in vm_map.c and apply it.