It does not matter, both should finally return the same result. But I agree with you that for performance reasons, one should first check whether some arguments are constants to go on with simpler cases. The example solution avoids the use of Apply, and just used ITE to the very end, which is also correct.