diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-06-16 13:45:33 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-16 13:45:33 -0700 |
| commit | 537104fd9d84d94abad3e36d3cd781be4397e299 (patch) | |
| tree | a77492de657f8a76c15bdeb443916490db79e1cd /lib/std/io/fixed_buffer_stream.zig | |
| parent | 5d9e8f27d0dc131e0b4154c5f65376f2fb9f3500 (diff) | |
| parent | 2af5bd8aa8711b2a6e60f961290372134090f235 (diff) | |
| download | zig-537104fd9d84d94abad3e36d3cd781be4397e299.tar.gz zig-537104fd9d84d94abad3e36d3cd781be4397e299.zip | |
Merge pull request #16025 from mlugg/feat/remove-std-math-minmax
Consider bounds when refining @min/@max result type; deprecate std.math.{min,max,min3,max3}
Diffstat (limited to 'lib/std/io/fixed_buffer_stream.zig')
| -rw-r--r-- | lib/std/io/fixed_buffer_stream.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/io/fixed_buffer_stream.zig b/lib/std/io/fixed_buffer_stream.zig index c170dd1f74..27b978744c 100644 --- a/lib/std/io/fixed_buffer_stream.zig +++ b/lib/std/io/fixed_buffer_stream.zig @@ -76,7 +76,7 @@ pub fn FixedBufferStream(comptime Buffer: type) type { } pub fn seekTo(self: *Self, pos: u64) SeekError!void { - self.pos = if (std.math.cast(usize, pos)) |x| std.math.min(self.buffer.len, x) else self.buffer.len; + self.pos = if (std.math.cast(usize, pos)) |x| @min(self.buffer.len, x) else self.buffer.len; } pub fn seekBy(self: *Self, amt: i64) SeekError!void { @@ -91,7 +91,7 @@ pub fn FixedBufferStream(comptime Buffer: type) type { } else { const amt_usize = std.math.cast(usize, amt) orelse std.math.maxInt(usize); const new_pos = std.math.add(usize, self.pos, amt_usize) catch std.math.maxInt(usize); - self.pos = std.math.min(self.buffer.len, new_pos); + self.pos = @min(self.buffer.len, new_pos); } } |
