我想知道下面两个之间有什么表现差异?两个小构造的性能差异
if(i>=0){
//some code here
}
//and
if(i>-1){
//some code here
}
接下来的两点是什么?
if(i>=0){
//some code here
}
//and
if(i>0 || i==0){
//some code here
}
是>=
将内部转换为> || ==
?
P.S.性能差异会很小,可能可以忽略不计,但我想知道是否有任何性能差异?
在每秒数百万CPU动作的时代,保存一个动作的动机是什么? – alfasin 2012-07-24 03:58:22
@alfasin - 对性能的痴迷就像火车发现 - 很难解释:-) – 2012-07-24 04:12:19