minor doc nitpick
ensure we short-circuit if no work todo.
don't allocate extra functions on each run if we don't need to.
only allocate the array if we are going to need it.