std: fix mismatched doc-comment/argument names in fifo.rewind

This commit is contained in:
daurnimator 2019-11-23 18:42:22 +11:00
parent 94485b2a58
commit 1a84bcefb6
No known key found for this signature in database
GPG Key ID: 45B429A8F9D9D22A

View File

@ -300,18 +300,18 @@ pub fn LinearFifo(
else
struct {};
/// Make `count` bytes available before the current read location
fn rewind(self: *Self, size: usize) void {
assert(self.writableLength() >= size);
/// Make `count` items available before the current read location
fn rewind(self: *Self, count: usize) void {
assert(self.writableLength() >= count);
var head = self.head + (self.buf.len - size);
var head = self.head + (self.buf.len - count);
if (powers_of_two) {
head &= self.buf.len - 1;
} else {
head %= self.buf.len;
}
self.head = head;
self.count += size;
self.count += count;
}
/// Place data back into the read stream