You have different ways of processing the result of the same conditional statement. Because of this, it is probably more effective (and easier on the eyes) to maintain it as it is.
If your return
expressions were the same for each conditional statement, then I would review the code, but each block of code has a different return
value and because of this makes it unique.
No, there is no way to simplify what you have done.
user596075
source share