luaur_bytecode/methods/
bytecode_builder_table_shape_hash_operator_call.rs1use crate::records::table_shape::TableShape;
2use crate::records::table_shape_hash::TableShapeHash;
3
4impl TableShapeHash {
5 #[allow(non_snake_case)]
6 pub fn operator_call(&self, v: &TableShape) -> usize {
7 let mut hash: u32 = 2166136261;
9
10 for i in 0..(v.length as usize) {
11 hash ^= v.keys[i] as u32;
12 hash = hash.wrapping_mul(16777619);
13
14 if v.hasConstants {
17 hash ^= v.constants[i] as u32;
18 hash = hash.wrapping_mul(16777619);
19 }
20 }
21
22 hash as usize
23 }
24}