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