Assuming that negative numbers are not a factor; is there a clear, quantifiable benefit (such as a performance difference) for comparing zero using the greater than or equal to operators?
For example, compare the two IF statements below:
if (x > 0) {
functionOne();
} else {
functionTwo();
}
if (x == 0) {
functionTwo();
} else {
functionOne();
}
Aucun commentaire:
Enregistrer un commentaire