Skip to content

Commit

Permalink
Fix hashCode() in Http2StreamChannelId
Browse files Browse the repository at this point in the history
Motivation:
In `Http2StreamChannelId` a `hashCode()` is not consistent with `equals()`.

Modifications:
Make a `Http2StreamChannelId.hashCode()` consistent with `equals()`.

Result:
Faster hash map's operations where the Http2StreamChannelId as keys.
  • Loading branch information
fenik17 authored and normanmaurer committed Sep 8, 2017
1 parent e404690 commit de9e666
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public int compareTo(ChannelId o) {

@Override
public int hashCode() {
return parentId.hashCode();
return id * 31 + parentId.hashCode();
}

@Override
Expand Down

0 comments on commit de9e666

Please sign in to comment.