Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8268113: Re-use Long.hashCode() where possible #4309

Closed
wants to merge 13 commits into from
@@ -877,8 +877,7 @@ public int hashCode() {
* @since 1.8
*/
public static int hashCode(double value) {
long bits = doubleToLongBits(value);
return Long.hashCode(bits);
return Long.hashCode(doubleToLongBits(value));
}

/**
@@ -1596,8 +1596,7 @@ public boolean equals(Object obj) {
*/
@Override
public int hashCode() {
long nod = toNanoOfDay();
return Long.hashCode(nod);
return Long.hashCode(toNanoOfDay());
}

//-----------------------------------------------------------------------
@@ -276,8 +276,7 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
long bits = asBits();
return Long.hashCode(bits);
return Long.hashCode(asBits());
}

/**