There's no need to treat FizzBuzz as a special case, as if the number is divisible by both it will have already met the conditions of the previous two statements.
I wonder if there's some magic you could sprinkle in to the iterator so it only iterates through numbers which are divisible by 3/5, ignoring the rest?
It probably wouldn't speed the operation up much (if at all) in this case, in a more complex real world scenario though it's best to look at every angle.
I wonder if there's some magic you could sprinkle in to the iterator so it only iterates through numbers which are divisible by 3/5, ignoring the rest?
It probably wouldn't speed the operation up much (if at all) in this case, in a more complex real world scenario though it's best to look at every angle.