MCPcopy Create free account
hub / github.com/davidgiven/luje / hashCode

Method hashCode

lib/java/util/Arrays.java:812–822  ·  view source on GitHub ↗

Returns a hash code based on the contents of the given array. For any two boolean arrays a and b, if Arrays.equals(a, b) returns true, it means that the return value of Arrays.hashCode(a) equals Arrays.hashCode(b). The value returned by thi

(boolean[] array)

Source from the content-addressed store, hash-verified

810 * @return the hash code for {@code array}.
811 */
812 public static int hashCode(boolean[] array) {
813 if (array == null) {
814 return 0;
815 }
816 int hashCode = 1;
817 for (boolean element : array) {
818 // 1231, 1237 are hash code values for boolean value
819 hashCode = 31 * hashCode + (element ? 1231 : 1237);
820 }
821 return hashCode;
822 }
823
824 /**
825 * Returns a hash code based on the contents of the given array. For any two

Callers 1

deepHashCodeElementMethod · 0.95

Calls 3

floatToIntBitsMethod · 0.95
doubleToLongBitsMethod · 0.95
hashCodeMethod · 0.65

Tested by

no test coverage detected