mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
std.fifo: make toOwnedSlice support head != 0
This commit is contained in:
parent
fbce6a749d
commit
53fb59ea9b
@ -385,6 +385,7 @@ pub fn LinearFifo(
|
||||
}
|
||||
|
||||
pub fn toOwnedSlice(self: *Self) Allocator.Error![]T {
|
||||
if (self.head != 0) self.realign();
|
||||
assert(self.head == 0);
|
||||
assert(self.count <= self.buf.len);
|
||||
const allocator = self.allocator;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user