Skip to content

Commit 5da6124

Browse files
committed
squash: second refack nit
1 parent c915b7e commit 5da6124

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/url.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,9 @@ Url.prototype.parse = function parse(url, parseQueryString, slashesDenoteHost) {
395395
this.query = Object.create(null);
396396
}
397397

398-
var firstIdx =
399-
questionIdx !== -1 && (hashIdx === -1 || questionIdx < hashIdx) ?
400-
questionIdx :
401-
hashIdx;
398+
const useQuestionIdx =
399+
questionIdx !== -1 && (hashIdx === -1 || questionIdx < hashIdx);
400+
const firstIdx = useQuestionIdx ? questionIdx : hashIdx;
402401
if (firstIdx === -1) {
403402
if (rest.length > 0)
404403
this.pathname = rest;

0 commit comments

Comments
 (0)