authorgravatar for kenta@lithdew.netKenta Iwasaki <kenta@lithdew.net> 2021-05-31 15:57:48+09:00
committergravatar for kenta@lithdew.netKenta Iwasaki <kenta@lithdew.net> 2021-06-01 18:24:43+09:00
log6950e4c2943d7eee1868aff1bf9e24f6bb310f60
treeb218b079cdf336eae55cb9622bff5192f76e7605
parent278e5d398ea137a4c81bd00b1f40e50a16755684

x/os/net: remove unnecessary comptime prefix in resolveScopeID()


3 files changed, 4 insertions(+), 4 deletions(-)

lib/std/mem.zig+1-1
......@@ -2201,7 +2201,7 @@ pub fn collapseRepeatsLen(comptime T: type, slice: []T, elem: T) usize {
22012201
22022202/// Collapse consecutive duplicate elements into one entry.
22032203pub fn collapseRepeats(comptime T: type, slice: []T, elem: T) []T {
2204 return slice[0 .. collapseRepeatsLen(T, slice, elem)];
2204 return slice[0..collapseRepeatsLen(T, slice, elem)];
22052205}
22062206
22072207fn testCollapseRepeats(str: []const u8, elem: u8, expected: []const u8) !void {
lib/std/os/windows.zig+1-1
......@@ -1844,7 +1844,7 @@ pub fn sliceToPrefixedFileW(s: []const u8) !PathSpace {
18441844}
18451845
18461846fn getFullPathNameW(path: [*:0]const u16, out: []u16) !usize {
1847 const result= kernel32.GetFullPathNameW(path, @intCast(u32, out.len), std.meta.assumeSentinel(out.ptr, 0), null);
1847 const result = kernel32.GetFullPathNameW(path, @intCast(u32, out.len), std.meta.assumeSentinel(out.ptr, 0), null);
18481848 if (result == 0) {
18491849 switch (kernel32.GetLastError()) {
18501850 else => |err| return unexpectedError(err),
lib/std/x/os/net.zig+2-2
......@@ -17,10 +17,10 @@ const native_os = std.Target.current.os;
1717/// an error if either resolution fails, or if the interface name is
1818/// too long.
1919pub fn resolveScopeID(name: []const u8) !u32 {
20 if (comptime @hasDecl(os, "IFNAMESIZE")) {
20 if (@hasDecl(os, "IFNAMESIZE")) {
2121 if (name.len >= os.IFNAMESIZE - 1) return error.NameTooLong;
2222
23 if (comptime native_os.tag == .windows) {
23 if (native_os.tag == .windows) {
2424 var interface_name: [os.IFNAMESIZE]u8 = undefined;
2525 mem.copy(u8, &interface_name, name);
2626 interface_name[name.len] = 0;