Skip to content

Commit 01fbe7b

Browse files
avivkellerpull[bot]
authored andcommitted
path: remove StringPrototypeCharCodeAt from posix.extname
PR-URL: #54546 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 11eaf19 commit 01fbe7b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/path.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1462,8 +1462,8 @@ const posix = {
14621462
// after any path separator we find
14631463
let preDotState = 0;
14641464
for (let i = path.length - 1; i >= 0; --i) {
1465-
const code = StringPrototypeCharCodeAt(path, i);
1466-
if (code === CHAR_FORWARD_SLASH) {
1465+
const char = path[i];
1466+
if (char === '/') {
14671467
// If we reached a path separator that was not part of a set of path
14681468
// separators at the end of the string, stop now
14691469
if (!matchedSlash) {
@@ -1478,7 +1478,7 @@ const posix = {
14781478
matchedSlash = false;
14791479
end = i + 1;
14801480
}
1481-
if (code === CHAR_DOT) {
1481+
if (char === '.') {
14821482
// If this is our first dot, mark it as the start of our extension
14831483
if (startDot === -1)
14841484
startDot = i;

0 commit comments

Comments
 (0)