|
|
|
|
|
by drt1245
5249 days ago
|
|
int a = f();
if (a < 0) a = 0;
has been replaced with
const int a = MAX(0,f());
I believe the latter will generally result in 2 calls to f() (unless it returns less than zero), which could cause undesired behavior or just be inefficient. Of course, it depends on what f() does.Assuming MAX(0,f()) expands to something like this: if( f() < 0 )
a = 0
else
a = f()
|
|