Current computation of hashCode() introduces needless computation,
just for the sake of the computation.
This patch changes the hashCode() algorithm and removes increment:
QName.hashCode() + 31
which has no real value to how hashCodeImpl() operates. While
we're in the area, we propagate useless invariants.
Change-Id: Ib18518013774673603268ad747883d67b5d2bbf3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
}
protected int hashCodeImpl() {
- return 31 + getNodeType().hashCode();
+ return nodeType.hashCode();
}
@Override
@Override
protected int hashCodeImpl() {
- final int prime = 31;
- int result = super.hashCodeImpl();
- result = prime * result + YangInstanceIdentifier.hashCode(value);
- return result;
+ return 31 * super.hashCodeImpl() + YangInstanceIdentifier.hashCode(value);
}
@Override