Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 38a811b

Browse files
committed
Use Objects.hash for calculate hash
1 parent 53e28d8 commit 38a811b

File tree

1 file changed

+1
-3
lines changed
  • app/src/main/java/com/annimon/java8streamexample

1 file changed

+1
-3
lines changed

‎app/src/main/java/com/annimon/java8streamexample/Word.java‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ public boolean equals(Object o) {
5151

5252
@Override
5353
public int hashCode() {
54-
int result = word.hashCode();
55-
result = 31 * result + translate.hashCode();
56-
return result;
54+
return Objects.hash(word, translate);
5755
}
5856

5957
@Override

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /