diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-04-29 00:19:55 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-29 00:19:55 -0700 |
| commit | d65b42e07caa00dfe2f2fbf221c593ce57882784 (patch) | |
| tree | 7926cbea1499e0affe930bf6d7455dc24adf014e /lib/std/http | |
| parent | fd6200eda6d4fe19c34a59430a88a9ce38d6d7a4 (diff) | |
| parent | fa200ca0cad2705bad40eb723dedf4e3bf11f2ff (diff) | |
| download | zig-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/http')
| -rw-r--r-- | lib/std/http/Client.zig | 2 | ||||
| -rw-r--r-- | lib/std/http/Headers.zig | 3 | ||||
| -rw-r--r-- | lib/std/http/Server.zig | 2 | ||||
| -rw-r--r-- | lib/std/http/protocol.zig | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/lib/std/http/Client.zig b/lib/std/http/Client.zig index e1f28e7921..42ef766bd3 100644 --- a/lib/std/http/Client.zig +++ b/lib/std/http/Client.zig @@ -284,7 +284,7 @@ pub const BufferedConnection = struct { if (available > 0) { const can_read = @truncate(u16, @min(available, left)); - std.mem.copy(u8, buffer[out_index..], bconn.buf[bconn.start..][0..can_read]); + @memcpy(buffer[out_index..][0..can_read], bconn.buf[bconn.start..][0..can_read]); out_index += can_read; bconn.start += can_read; diff --git a/lib/std/http/Headers.zig b/lib/std/http/Headers.zig index 0322c32481..376fd60b61 100644 --- a/lib/std/http/Headers.zig +++ b/lib/std/http/Headers.zig @@ -38,7 +38,8 @@ pub const Field = struct { pub fn modify(entry: *Field, allocator: Allocator, new_value: []const u8) !void { if (entry.value.len <= new_value.len) { - std.mem.copy(u8, @constCast(entry.value), new_value); + // TODO: eliminate this use of `@constCast`. + @memcpy(@constCast(entry.value)[0..new_value.len], new_value); } else { allocator.free(entry.value); diff --git a/lib/std/http/Server.zig b/lib/std/http/Server.zig index 66adb1bb96..c7f2a86c27 100644 --- a/lib/std/http/Server.zig +++ b/lib/std/http/Server.zig @@ -128,7 +128,7 @@ pub const BufferedConnection = struct { if (available > 0) { const can_read = @truncate(u16, @min(available, left)); - std.mem.copy(u8, buffer[out_index..], bconn.buf[bconn.start..][0..can_read]); + @memcpy(buffer[out_index..][0..can_read], bconn.buf[bconn.start..][0..can_read]); out_index += can_read; bconn.start += can_read; diff --git a/lib/std/http/protocol.zig b/lib/std/http/protocol.zig index 962376ce82..c6bdd76272 100644 --- a/lib/std/http/protocol.zig +++ b/lib/std/http/protocol.zig @@ -654,7 +654,7 @@ const MockBufferedConnection = struct { if (available > 0) { const can_read = @truncate(u16, @min(available, left)); - std.mem.copy(u8, buffer[out_index..], bconn.buf[bconn.start..][0..can_read]); + @memcpy(buffer[out_index..][0..can_read], bconn.buf[bconn.start..][0..can_read]); out_index += can_read; bconn.start += can_read; |
