File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1463,7 +1463,10 @@ function getPathFromURLWin32(url) {
14631463 }
14641464 }
14651465 pathname = SideEffectFreeRegExpPrototypeSymbolReplace ( FORWARD_SLASH , pathname , '\\' ) ;
1466- pathname = decodeURIComponent ( pathname ) ;
1466+ // Fast-path: if there is no percent-encoding, avoid decodeURIComponent.
1467+ if ( StringPrototypeIncludes ( pathname , '%' ) ) {
1468+ pathname = decodeURIComponent ( pathname ) ;
1469+ }
14671470 if ( hostname !== '' ) {
14681471 // If hostname is set, then we have a UNC path
14691472 // Pass the hostname through domainToUnicode just in case
@@ -1569,7 +1572,8 @@ function getPathFromURLPosix(url) {
15691572 }
15701573 }
15711574 }
1572- return decodeURIComponent ( pathname ) ;
1575+ // Fast-path: if there is no percent-encoding, avoid decodeURIComponent.
1576+ return StringPrototypeIncludes ( pathname , '%' ) ? decodeURIComponent ( pathname ) : pathname ;
15731577}
15741578
15751579function getPathBufferFromURLPosix ( url ) {
You can’t perform that action at this time.
0 commit comments