Refactor: scheduler: improve efficiency when checking whether recurring should be optional
Previously, RecurringOp() performed a number of tests to decide whether a
recurring action for an active role should be optional or mandatory. It always
performed all these tests, regardless of whether a previous test had already
decided the question.
Now, functionize the check, which allows us to more efficiently short-circuit
once we have an answer.
This makes explicit the test for a NULL node that was previously implicit in
the call to find_actions_exact(), which allows a better trace message.