Skip to content

I20210320-0650

tagged this 20 Mar 10:52
Operand factorization

Replaces (X && Y) || (X && Z) by (X && (Y || Y)):
 - The syntax becomes shorter
 - It removes redundant information
 - There are less operators

Given:
boolean newBoolean = repeatedBoolean && !isValid || repeatedBoolean &&
isActive;

When:
Clean up the code enabling "Replace (X && Y) || (X && Z) by (X && (Y ||
Y))"

Then:
boolean newBoolean = (repeatedBoolean && (!isValid || isActive));

Change-Id: I4c4f563447980bce11ee4b8e08fd36bb54a29a96
Signed-off-by: Fabrice Tiercelin <fabrice.tiercelin@yahoo.fr>
Assets 2
Loading