diff --git a/src/root.zig b/src/root.zig index e6c0e438a4bb4bec219cbc45984250565216b934..61879a5f182a1cc771dcd74a4bee157e2c60f560 100644 --- a/src/root.zig +++ b/src/root.zig @@ -70,11 +70,6 @@ pub fn bidiPairedBracketType(cp: u32) ?ucd.bidi_brackets.BracketPairing.Type { } pub fn toLower(cp: u32) ?u32 { - @setEvalBranchQuota(100_000); - inline for (ucd.unicode_data.data) |row| { - if (comptime row[11]) |lc| { - if (cp == row[0]) return lc; - } - } - return null; + if (cp > std.math.maxInt(u21)) return null; + return ucd.unicode_data.find(@intCast(cp))[11] orelse null; // https://github.com/ziglang/zig/issues/16765 }