Shift by _eight_ bits and magically everything is fast

This commit is contained in:
K. Lange 2021-02-14 15:03:33 +09:00
parent 419fcbfa45
commit e287b74973

View File

@ -15,7 +15,7 @@ static KrkValue _tuple_init(int argc, KrkValue argv[], int hasKw) {
inline void krk_tupleUpdateHash(KrkTuple * self) {
self->obj.hash = self->values.count;
for (size_t i = 0; i < (size_t)self->values.count; ++i) {
self->obj.hash <<= 4;
self->obj.hash <<= 8;
self->obj.hash ^= krk_hashValue(self->values.values[i]);
}
}