mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Return early when no candidates exist
This commit is contained in:
@@ -121,6 +121,9 @@ resolveModulePath = (relativePath, parentModule) ->
|
||||
return if relativePath[0] is '.'
|
||||
return if isAbsolute(relativePath)
|
||||
|
||||
candidates = cache.dependencies[relativePath]
|
||||
return unless candidates?
|
||||
|
||||
folderPath = path.dirname(parentModule.filename)
|
||||
|
||||
range = cache.folders[folderPath]?[relativePath]
|
||||
@@ -130,9 +133,6 @@ resolveModulePath = (relativePath, parentModule) ->
|
||||
else
|
||||
return
|
||||
|
||||
candidates = cache.dependencies[relativePath]
|
||||
return unless candidates?
|
||||
|
||||
for version, resolvedPath of candidates
|
||||
if Module._cache.hasOwnProperty(resolvedPath) or isCorePath(resolvedPath)
|
||||
return resolvedPath if satisfies(version, range)
|
||||
|
||||
Reference in New Issue
Block a user