There are two changes here. The first is that the aCheckEdgeOnly case is factored out into a separate branch so as to avoid branching on aCheckEdgeOnly inside the sibling loop. This also allows us to reuse the IndexDetermined code for both aIsFromEnd and !aIsFromEnd cases. In particular, when aIsFromEnd we start by walking backwards and hoping for a cached index on a previous sibling and only walking forwards if that fails. For short child lists there's not that much of a difference, but for long ones this is a win.
mozalloc_undef_macro_wrappers are brittle and have side-effects that are hard
to debug and fix. The alternative is the just stick an underscore on the end of
malloc, free, etc, which is a comparatively small burden.