aboutsummaryrefslogtreecommitdiff
path: root/lib/std/io/fixed_buffer_stream.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-04-29 00:19:55 -0700
committerGitHub <noreply@github.com>2023-04-29 00:19:55 -0700
commitd65b42e07caa00dfe2f2fbf221c593ce57882784 (patch)
tree7926cbea1499e0affe930bf6d7455dc24adf014e /lib/std/io/fixed_buffer_stream.zig
parentfd6200eda6d4fe19c34a59430a88a9ce38d6d7a4 (diff)
parentfa200ca0cad2705bad40eb723dedf4e3bf11f2ff (diff)
downloadzig-d65b42e07caa00dfe2f2fbf221c593ce57882784.tar.gz
zig-d65b42e07caa00dfe2f2fbf221c593ce57882784.zip
Merge pull request #15481 from ziglang/use-mem-intrinsics
actually use the new memory intrinsics
Diffstat (limited to 'lib/std/io/fixed_buffer_stream.zig')
-rw-r--r--lib/std/io/fixed_buffer_stream.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/io/fixed_buffer_stream.zig b/lib/std/io/fixed_buffer_stream.zig
index 2fcb260c72..c170dd1f74 100644
--- a/lib/std/io/fixed_buffer_stream.zig
+++ b/lib/std/io/fixed_buffer_stream.zig
@@ -45,10 +45,10 @@ pub fn FixedBufferStream(comptime Buffer: type) type {
}
pub fn read(self: *Self, dest: []u8) ReadError!usize {
- const size = std.math.min(dest.len, self.buffer.len - self.pos);
+ const size = @min(dest.len, self.buffer.len - self.pos);
const end = self.pos + size;
- mem.copy(u8, dest[0..size], self.buffer[self.pos..end]);
+ @memcpy(dest[0..size], self.buffer[self.pos..end]);
self.pos = end;
return size;
@@ -67,7 +67,7 @@ pub fn FixedBufferStream(comptime Buffer: type) type {
else
self.buffer.len - self.pos;
- mem.copy(u8, self.buffer[self.pos .. self.pos + n], bytes[0..n]);
+ @memcpy(self.buffer[self.pos..][0..n], bytes[0..n]);
self.pos += n;
if (n == 0) return error.NoSpaceLeft;