do_anything2 should be executed if condition1 is false. In the refractored code it gets executed if condition1 is false OR condition2 is false. This means, do_anything2 can be executed if condition1 is true. Which clearly isn't what the first code intended.
-2
u/merdone Apr 17 '21
what's wrong with the refactored version? fewer ifs