From bfc885cbb11773e04634011f96a366b9960cdad3 Mon Sep 17 00:00:00 2001 From: fdai7783 Date: Sun, 4 Feb 2024 13:51:43 +0100 Subject: [PATCH] refactoring: optimized identity_disconjunctive --- src/main/py/logical_operations.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/py/logical_operations.py b/src/main/py/logical_operations.py index 42678a1..3b0ac5a 100644 --- a/src/main/py/logical_operations.py +++ b/src/main/py/logical_operations.py @@ -1,10 +1,10 @@ -def identity_disconjunctive(variable, operator, zero): - if zero == 0 and operator == "+": - return variable - elif variable == 0 and zero == 1: - return 1 - else: +def identity_disconjunctive(first_input, operator, second_input): + if first_input == 1 and second_input == 1: return None + elif first_input == 0 and second_input == 0: + return 0 + else: + return 1 def identity_conjunctive(variable, operator, zero):