0
if (foo() && bar())

Does the program still execute bar() even if foo() is false? Or is it a better idea to write

if (foo())
    if (bar())

to avoid bar() from being called, if it is a heavy function, for example?

Post Self
  • 1,471
  • 2
  • 14
  • 34

0 Answers0