Encountered such a scene at work
If branch A is performed first, the result will be returned, if not, branch B will be performed....
At this point, it is found that if the judgment order of A and B is exchanged, the result of the judgment order is the same
First perform B branch, if yes, return the result, if not, perform A branch....
Now that the two logical results are in different order but the results are the same, is it free to choose?
The answer is no. It should be judged according to the actual production scenarios and data, whether A has more results of shunting or B has more results, and put the logic blocks with more shunting in the front. This is the best.
Is there a professional word for this in programming? Just a gut feeling it should be.