But in some cases the code can't be replaced by just using "if" instead of "&&":
ENTITY* ent = NULL;
if(ent != NULL) {
if (is(ent, FLAG1)) {
... do something ...
} else {
... do something else ...
}
} else {
... do something else (the same else as above) ...
}
For this code I need either code duplication or I have to set a boolean and check this to decide which code has to be executed.
But it could be like this:
ENTITY* ent = NULL;
if(ent != NULL && is(ent, FLAG1)) {
... do something ...
} else {
... do something else ...
}
So it makes the code worse and longer.
Regards,
Pegamode.