mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 03:18:53 +00:00
12 lines
270 B
Zig
12 lines
270 B
Zig
pub fn zCount(slice: []const u8) usize {
|
|
return if (slice.len > 0) slice.len + 1 else 0;
|
|
}
|
|
|
|
pub fn zFieldCount(prefix: []const u8, slice: []const u8) usize {
|
|
if (slice.len > 0) {
|
|
return zCount(prefix) + zCount(slice);
|
|
}
|
|
|
|
return zCount(prefix);
|
|
}
|