mirror of
https://codeberg.org/kaasboteram/zig-iterating.git
synced 2025-12-15 09:43:14 +01:00
Add size hint for Chain
This commit is contained in:
parent
39b27061e0
commit
0928cb3f98
1 changed files with 4 additions and 0 deletions
|
|
@ -320,6 +320,10 @@ pub const adapters = struct {
|
|||
pub fn next(self: *Self) ?Item {
|
||||
return if (self.first.next()) |x| x else self.second.next();
|
||||
}
|
||||
|
||||
pub fn sizeHint(self: *const Self) usize {
|
||||
return self.first.sizeHint() + self.second.sizeHint();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue