Skip to content

Commit 6a3bf3c

Browse files
tniessenMylesBorins
authored andcommitted
url: simplify loop in parser
PR-URL: #18468 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 89fba18 commit 6a3bf3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/url.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ Url.prototype.resolveObject = function resolveObject(relative) {
880880

881881
// if the path is allowed to go above the root, restore leading ..s
882882
if (!mustEndAbs && !removeAllDots) {
883-
for (; up--; up) {
883+
while (up--) {
884884
srcPath.unshift('..');
885885
}
886886
}

0 commit comments

Comments
 (0)