I'm working on improving the performance of a Java
program.
After I've improved the data structures
and the algorithm's complexity, I'm trying to improve the implementation. I want to know if it really matters how I use the if
statement in condition.
Does the compiler treat these two versions the same? Do they cost the same (If I have much more variables inside the if
statement)?
if(a && b && c && d && e && f && g)
OR
if(a)
if(b)
if(c)
if(d)
if(e)
if(f)
if(g)
(In this specific project I don't really care about readability, I know the second is less readable)
See Question&Answers more detail:os