MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / SIArray_HashCode

Function SIArray_HashCode

src/datatypes/array.c:170–181  ·  view source on GitHub ↗

this method referenced by Java ArrayList.hashCode() method, which takes into account the hasing of nested values

Source from the content-addressed store, hash-verified

168// this method referenced by Java ArrayList.hashCode() method, which takes
169// into account the hasing of nested values
170XXH64_hash_t SIArray_HashCode(SIValue siarray) {
171 SIType t = T_ARRAY;
172 XXH64_hash_t hashCode = XXH64(&t, sizeof(t), 0);
173
174 uint arrayLen = SIArray_Length(siarray);
175 for(uint i = 0; i < arrayLen; i++) {
176 SIValue value = siarray.array[i];
177 hashCode = 31 * hashCode + SIValue_HashCode(value);
178 }
179
180 return hashCode;
181}
182
183// creates an array from its binary representation
184// this is the reverse of SIArray_ToBinary

Callers 1

SIValue_HashUpdateFunction · 0.85

Calls 2

SIArray_LengthFunction · 0.85
SIValue_HashCodeFunction · 0.85

Tested by

no test coverage detected