Skip to content

Commit e586f82

Browse files
michael-berger-FRlemoncurry
authored andcommitted
[Allergies] Small simplification (exercism#1689)
Bit wise AND oeprator is used to check if the person is allergic to a given allergen. If the result is different from 0, this is the case.
1 parent aee9012 commit e586f82

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎exercises/allergies/.meta/src/reference/java/Allergies.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ List<Allergen> getList() {
1717
}
1818

1919
boolean isAllergicTo(Allergen allergen) {
20-
return (score & allergen.getScore()) == allergen.getScore();
20+
return (score & allergen.getScore()) != 0;
2121
}
2222
}

0 commit comments

Comments
 (0)