fn findLinked(self: *Self, code: u16, start: u16) !Symbol self: *Selfcode: u16start: u16781
782
783
784
785
786
787
788
789
790
791
792
793 fn findLinked(self: *Self, code: u16, start: u16) !Symbol {
if (start == 0xfff) return error.InvalidCode;
if (lookup_bits == max_code_bits) unreachable;
var pos = start;
while (true) {
const node = self.linked[pos];
const shift = -%node.sym.code_bits;
// compare code_bits number of upper bits
if ((code ^ node.code) << shift == 0)
return .{ .value = @intCast(pos), .code_bits = node.sym.code_bits };
pos = node.sym.value;
}
}