Performance: greater / smaller than vs not equal to

前端 未结 7 1600
礼貌的吻别
礼貌的吻别 2020-12-14 14:47

I wonder if there is a difference in performance between

checking if a value is greater / smaller than another

for(int x = 0; x <         


        
7条回答
  •  清歌不尽
    2020-12-14 15:29

    Wonder if nested for each test, same results ?

    for(int x = 0; x < y; x++)
    {   
      for(int x2 = 0; x2 < y; x2++)  {}   
    }
    
    for(int x = 0; x != y; x++)
    {
      for(int x2 = 0; x2 != y; x2++) {}    
    }
    

提交回复
热议问题