From 489cacda951fa4837115334e702799ff89f029ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Fri, 13 Sep 2024 11:29:06 +0200 Subject: [PATCH] chore: remove redundant checks in basicParser --- url/parser.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/url/parser.go b/url/parser.go index 4b88235..60be1f4 100644 --- a/url/parser.go +++ b/url/parser.go @@ -216,13 +216,13 @@ func (p *parser) basicParser(urlOrRef string, base *Url, url *Url, stateOverride if err := p.handleError(url, errors.MissingSchemeNonRelativeURL, true); err != nil { return nil, err } - } else if base != nil && base.path.isOpaque() && r == '#' { + } else if base.path.isOpaque() && r == '#' { url.scheme = base.scheme url.path = base.path // TODO: Ensure copy???? url.query = base.query url.fragment = new(string) state = stateFragment - } else if base != nil && base.scheme != "file" { + } else if base.scheme != "file" { state = stateRelative input.rewindLast() } else {