Commit 1a84bcefb6

daurnimator <quae@daurnimator.com>
2019-11-23 08:42:22
std: fix mismatched doc-comment/argument names in fifo.rewind
1 parent 94485b2
Changed files (1)
lib
lib/std/fifo.zig
@@ -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