Which one will execute faster, if (flag==0) or if (0==flag)?

后端 未结 16 822
灰色年华
灰色年华 2020-11-30 17:12

Interview question: Which one will execute faster, if (flag==0) or if (0==flag)? Why?

16条回答
  •  日久生厌
    2020-11-30 17:54

    If at all there was a difference, what stops compiler to choose the faster once? So logically, there can't be any difference. Probably this is what the interviewer expects. It is actually a brilliant question.

提交回复
热议问题