Add size hint for Range

This commit is contained in:
Luuk Machielse 2025-12-09 17:09:35 +01:00
parent 8df72a0c79
commit 9bb6c03127

View file

@ -362,6 +362,10 @@ pub fn Range(comptime T: type, end_type: RangeEndType) type {
defer self.current += 1;
return self.current;
}
pub fn sizeHint(self: *const Self) usize {
return self.end - self.current + @intFromBool(end_type == .inclusive);
}
};
}