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
1 changed files with 1 additions and 3 deletions

View File

@ -171,9 +171,7 @@ public abstract class Triple<L, M, R> implements Comparable<Triple<L, M, R>>, Se
*/
@Override
public int hashCode() {
return (getLeft() == null ? 0 : getLeft().hashCode()) ^
(getMiddle() == null ? 0 : getMiddle().hashCode()) ^
(getRight() == null ? 0 : getRight().hashCode());
return Objects.hashCode(getLeft()) ^ Objects.hashCode(getMiddle()) ^ Objects.hashCode(getRight());
}
/**