| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1463,7 +1463,10 @@ function getPathFromURLWin32(url) { | |||
| 1463 | 1463 | } | |
| 1464 | 1464 | } | |
| 1465 | 1465 | 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 | + } | ||
| 1467 | 1470 | if (hostname !== '') { | |
| 1468 | 1471 | // If hostname is set, then we have a UNC path | |
| 1469 | 1472 | // Pass the hostname through domainToUnicode just in case | |
@@ -1569,7 +1572,8 @@ function getPathFromURLPosix(url) { | |||
| 1569 | 1572 | } | |
| 1570 | 1573 | } | |
| 1571 | 1574 | } | |
| 1572 | - return decodeURIComponent(pathname); | ||
| 1575 | + // Fast-path: if there is no percent-encoding, avoid decodeURIComponent. | ||
| 1576 | + return StringPrototypeIncludes(pathname, '%') ? decodeURIComponent(pathname) : pathname; | ||
| 1573 | 1577 | } | |
| 1574 | 1578 | ||
| 1575 | 1579 | function getPathBufferFromURLPosix(url) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments