Simplify null checks in Triple.hashCode() using Objects.hashCode(). (#516)

This commit is contained in:
Isira Seneviratne 2020-04-20 20:43:46 +00:00 committed by GitHub
parent d7f8dcedfa
commit c7ab53f9e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -171,9 +171,7 @@ public boolean equals(final Object obj) {
*/ */
@Override @Override
public int hashCode() { public int hashCode() {
return (getLeft() == null ? 0 : getLeft().hashCode()) ^ return Objects.hashCode(getLeft()) ^ Objects.hashCode(getMiddle()) ^ Objects.hashCode(getRight());
(getMiddle() == null ? 0 : getMiddle().hashCode()) ^
(getRight() == null ? 0 : getRight().hashCode());
} }
/** /**