Remove double comparing of content out of the DefaultHttp2GoAwayFrame.equals()
Motivation: In `DefaultHttp2GoAwayFrame.equals()` a content compared twice: explicitly and in the `super` method. Modifications: Remove explicit content comparision. Make `hashCode()` consistent with `equals()`. Result: A `DefaultHttp2GoAwayFrame.equals()` work faster.
This commit is contained in:
parent
870b5f5e4b
commit
e500755086
@ -160,15 +160,13 @@ public final class DefaultHttp2GoAwayFrame extends DefaultByteBufHolder implemen
|
||||
return false;
|
||||
}
|
||||
DefaultHttp2GoAwayFrame other = (DefaultHttp2GoAwayFrame) o;
|
||||
return super.equals(o) && errorCode == other.errorCode && content().equals(other.content())
|
||||
&& extraStreamIds == other.extraStreamIds;
|
||||
return errorCode == other.errorCode && extraStreamIds == other.extraStreamIds && super.equals(other);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 237395317;
|
||||
int hash = super.hashCode();
|
||||
hash = hash * 31 + (int) (errorCode ^ (errorCode >>> 32));
|
||||
hash = hash * 31 + content().hashCode();
|
||||
hash = hash * 31 + extraStreamIds;
|
||||
return hash;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user