When you are dealing with programming a stream of control problems, less code is not really the attribute you want to optimize. This is much better with structural issues to keep your code simple and readable.
So, for the above, the first option is not bad, although the “through” case for 2 can easily be missed. It is best to make the parent switch 1 or 2, then in the second case, call another function that processes the sub-series (formally 2 and 3), and make it manageable using another (sub-file) variable (make sure that you do not overload the "value" source variable "value".
Philosophically, all three cases are part of the same switch, otherwise they are not. If they are, then they should be treated equally (and indistinguishably from each other). If this is not the case, then they must be controlled by two separate variables and processed in two separate functions. An attempt to save bandwidth by combining them complicates the situation unnecessarily.
Pavel.
source share