authorgravatar for git@l4.pmLuna <git@l4.pm> 2020-03-30 16:01:22-03:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-06-02 14:56:06-04:00
log5919831529418ddf019b69e13ccccfce64837638
tree1cc9a4d6b5b1cc784cfff611d095d45f2eccf66a
parent901aab8761daa5c2dae5e470d51f5b3bf76e2b78

Stop using mem.len on array


1 files changed, 5 insertions(+), 3 deletions(-)

lib/std/net.zig+5-3
...@@ -273,10 +273,12 @@ pub const Address = extern union {...@@ -273,10 +273,12 @@ pub const Address = extern union {
273 }273 }
274274
275 var resolved_scope_id: u32 = 0;275 var resolved_scope_id: u32 = 0;
276 if (std.mem.len(scope_id_value) > 0) {276 std.debug.warn("scope_id_value {} len {}\n", .{ scope_id_value, std.mem.len(scope_id_value) });
277 resolved_scope_id = std.fmt.parseInt(u32, &scope_id_value, 10) catch |err| blk: {277 if (scope_id_index > 0) {
278 const scope_id_str = scope_id_value[0..scope_id_index];
279 resolved_scope_id = std.fmt.parseInt(u32, scope_id_str, 10) catch |err| blk: {
278 if (err != error.InvalidCharacter) return err;280 if (err != error.InvalidCharacter) return err;
279 break :blk try if_nametoindex(&scope_id_value);281 break :blk try if_nametoindex(scope_id_str);
280 };282 };
281 }283 }
282284