mirror of https://github.com/nodejs/node.git
module: minor performance improvement
PR-URL: https://github.com/nodejs/node/pull/16125 Reviewed-By: Anna Henningsen <anna@addaleax.net>pull/16201/head
parent
1a9f48a875
commit
695b307cc6
|
@ -218,14 +218,9 @@ Module._findPath = function(request, paths, isMain) {
|
|||
if (!filename && rc === 1) { // Directory.
|
||||
if (exts === undefined)
|
||||
exts = Object.keys(Module._extensions);
|
||||
filename = tryPackage(basePath, exts, isMain);
|
||||
}
|
||||
|
||||
if (!filename && rc === 1) { // Directory.
|
||||
filename = tryPackage(basePath, exts, isMain) ||
|
||||
// try it with each of the extensions at "index"
|
||||
if (exts === undefined)
|
||||
exts = Object.keys(Module._extensions);
|
||||
filename = tryExtensions(path.resolve(basePath, 'index'), exts, isMain);
|
||||
tryExtensions(path.resolve(basePath, 'index'), exts, isMain);
|
||||
}
|
||||
|
||||
if (filename) {
|
||||
|
|
Loading…
Reference in New Issue