mirror of
https://github.com/ziglang/zig.git
synced 2025-12-30 18:13:19 +00:00
Split at zero byte in SplitIterator
To avoid extra zeros in buffers
This commit is contained in:
parent
e5627f8e63
commit
6a8fb06006
@ -47,7 +47,7 @@ bool ptr_eq(const void *a, const void *b) {
|
||||
// Ported from std/mem.zig.
|
||||
bool SplitIterator_isSplitByte(SplitIterator *self, uint8_t byte) {
|
||||
for (size_t i = 0; i < self->split_bytes.len; i += 1) {
|
||||
if (byte == self->split_bytes.ptr[i]) {
|
||||
if (byte == self->split_bytes.ptr[i] || byte == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user