From ca434fba6e2373cafc04fe75b349ffd3e1c47d74 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Mon, 21 Nov 2022 17:37:12 -0800 Subject: make it slightly clearer --- src/url.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/url.zig b/src/url.zig index f51c8cc55..34979df3f 100644 --- a/src/url.zig +++ b/src/url.zig @@ -228,7 +228,9 @@ pub const URL = struct { offset += url.parseProtocol(base[offset..]) orelse 0; } - if (!(!is_protocol_relative and base[0] == '/')) { + const is_relative_path = !is_protocol_relative and base[0] == '/'; + + if (!is_relative_path) { // if there's no protocol or @, it's ambiguous whether the colon is a port or a username. if (offset > 0) { -- cgit v1.2.3