diff options
| author | daurnimator <quae@daurnimator.com> | 2019-12-28 14:34:00 +1100 |
|---|---|---|
| committer | daurnimator <quae@daurnimator.com> | 2019-12-28 14:39:38 +1100 |
| commit | 5843a6e3bc1a6353f76ebca57d6099337b90139a (patch) | |
| tree | f1a0a0f0dce77adc395c5ae10bb1721732363641 /lib/std/array_list.zig | |
| parent | 8b72eedc76f46b978843344f92605acb4ee4061a (diff) | |
| download | zig-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/array_list.zig')
0 files changed, 0 insertions, 0 deletions
