| ... | ... | @@ -300,18 +300,18 @@ pub fn LinearFifo( |
| 300 | 300 | else |
| 301 | 301 | struct {}; |
| 302 | 302 | |
| 303 | | /// Make `count` bytes available before the current read location |
| 304 | | fn rewind(self: *Self, size: usize) void { |
| 305 | | assert(self.writableLength() >= size); |
| 303 | /// Make `count` items available before the current read location |
| 304 | fn rewind(self: *Self, count: usize) void { |
| 305 | assert(self.writableLength() >= count); |
| 306 | 306 | |
| 307 | | var head = self.head + (self.buf.len - size); |
| 307 | var head = self.head + (self.buf.len - count); |
| 308 | 308 | if (powers_of_two) { |
| 309 | 309 | head &= self.buf.len - 1; |
| 310 | 310 | } else { |
| 311 | 311 | head %= self.buf.len; |
| 312 | 312 | } |
| 313 | 313 | self.head = head; |
| 314 | | self.count += size; |
| 314 | self.count += count; |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | /// Place data back into the read stream |