From 07e4ba2519b951711a9ed0721fd25fa6174986e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Tue, 30 Jan 2018 23:40:29 +0100 Subject: [PATCH] url: simplify loop in parser PR-URL: https://github.com/nodejs/node/pull/18468 Reviewed-By: Ruben Bridgewater Reviewed-By: Tiancheng "Timothy" Gu Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca --- lib/url.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/url.js b/lib/url.js index d27891d36b12d2..cb524fd9a87347 100644 --- a/lib/url.js +++ b/lib/url.js @@ -883,7 +883,7 @@ Url.prototype.resolveObject = function resolveObject(relative) { // if the path is allowed to go above the root, restore leading ..s if (!mustEndAbs && !removeAllDots) { - for (; up--; up) { + while (up--) { srcPath.unshift('..'); } }