Removing redundancy in (a==b) and 1 or 0

Change-Id: I95ac07b1199dc2282b7a238e6fe44477885226c3