Skip to content

Commit d756a3c

Browse files
committed
use includes instead of indexof
1 parent 0bd997f commit d756a3c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/internal/url.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,7 @@ function getPathFromURLWin32(url) {
14731473
}
14741474
pathname = SideEffectFreeRegExpPrototypeSymbolReplace(FORWARD_SLASH, pathname, '\\');
14751475
// Fast-path: if there is no percent-encoding, avoid decodeURIComponent.
1476-
if (StringPrototypeIndexOf(pathname, '%') !== -1) {
1476+
if (StringPrototypeIncludes(pathname, '%')) {
14771477
pathname = decodeURIComponent(pathname);
14781478
}
14791479
if (hostname !== '') {
@@ -1582,7 +1582,7 @@ function getPathFromURLPosix(url) {
15821582
}
15831583
}
15841584
// Fast-path: if there is no percent-encoding, avoid decodeURIComponent.
1585-
return StringPrototypeIndexOf(pathname, '%') !== -1 ? decodeURIComponent(pathname) : pathname;
1585+
return StringPrototypeIncludes(pathname, '%') ? decodeURIComponent(pathname) : pathname;
15861586
}
15871587

15881588
function getPathBufferFromURLPosix(url) {

0 commit comments

Comments
 (0)