| author | |
| committer | |
| log | b303caba8d260bb4d1a3fc7a29d983a6a56bb8ce |
| tree | 8091b82e72652d2f2c276db46970df8819fce50f |
| parent | 41656e532f2229c6dcd4b512f2a170983988c299 |
1 files changed, 8 insertions(+), 0 deletions(-)
src/lib.zig+8| ... | ... | @@ -404,3 +404,11 @@ pub fn BufIndexer(comptime T: type, comptime endian: std.builtin.Endian) type { |
| 404 | 404 | } |
| 405 | 405 | }; |
| 406 | 406 | } |
| 407 | ||
| 408 | pub fn skipToBoundary(pos: u64, boundary: u64, reader: anytype) !void { | |
| 409 | // const gdiff = counter.bytes_read % 4; | |
| 410 | // for (range(if (gdiff > 0) 4 - gdiff else 0)) |_| { | |
| 411 | const a = pos; | |
| 412 | const b = boundary; | |
| 413 | try reader.skipBytes(((a + (b - 1)) & ~(b - 1)) - a, .{}); | |
| 414 | } |