aboutsummaryrefslogtreecommitdiff
path: root/lib/std/testing.zig
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2019-12-28 14:34:00 +1100
committerdaurnimator <quae@daurnimator.com>2019-12-28 14:39:38 +1100
commit5843a6e3bc1a6353f76ebca57d6099337b90139a (patch)
treef1a0a0f0dce77adc395c5ae10bb1721732363641 /lib/std/testing.zig
parent8b72eedc76f46b978843344f92605acb4ee4061a (diff)
downloadzig-5843a6e3bc1a6353f76ebca57d6099337b90139a.tar.gz
zig-5843a6e3bc1a6353f76ebca57d6099337b90139a.zip
std: optimise utf8ByteSequenceLength
Also tested (but not as fast): ```zig pub fn utf8ByteSequenceLength(first_byte: u8) !u3 { const len = @clz(u8, ~first_byte); if (len == 0) return 1; if (len < 4) return @intCast(u3, len); return error.Utf8InvalidStartByte; } ```
Diffstat (limited to 'lib/std/testing.zig')
0 files changed, 0 insertions, 0 deletions