I am wondering if nested is better than the AND operator. I have a loop that goes on so many times, so I am thinking of faster execution. Below is a code that has the same logic with my code. The nested if statement is inside the loop.
for ( int i = 0; i < array.length; i++)
{
if (x == 5)
{
if (y == 3)
{
}
}
}
Will my code be faster with a significant difference if I replace the nested one, if with this and the STATEMENT?
if ((x == 5) && (y == 3))
// do stuff
I read this link, but I did not find the answer. I am a student and still studied, thanks for all the feedback!
source
share