this method referenced by Java ArrayList.hashCode() method, which takes into account the hasing of nested values
| 168 | // this method referenced by Java ArrayList.hashCode() method, which takes |
| 169 | // into account the hasing of nested values |
| 170 | XXH64_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 |
no test coverage detected