3 ms·
They both share a dependency due to nesting or the else statement. A third option may be more maintainable depending on context. if (a) { doSomething();
by Retric 11y ago
They both share a dependency due to nesting or the else statement. A third option may be more maintainable depending on context.
if (a) {
doSomething();
}
if ((a && b)||c) {
doSomethingElse();
}
Granted, this is a case where refactoring is fairly trivial.
PS: The real question is does doSomethingElse depend on doSomething.