mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-17 11:17:17 +03:00
Added small simplification and performance improvement in code path that adds a new tracked file. No functional change.
This commit is contained in:
parent
bc15a7b742
commit
23cac90295
@ -3351,10 +3351,8 @@ export class Program {
|
||||
if (!updatedImportMap.has(normalizedImportPath)) {
|
||||
// We found a new import to add. See if it's already part
|
||||
// of the program.
|
||||
let importedFileInfo: SourceFileInfo;
|
||||
if (this.getSourceFileInfo(importInfo.path)) {
|
||||
importedFileInfo = this.getSourceFileInfo(importInfo.path)!;
|
||||
} else {
|
||||
let importedFileInfo = this.getSourceFileInfo(importInfo.path);
|
||||
if (!importedFileInfo) {
|
||||
const importName = this._getImportNameForFile(importInfo.path);
|
||||
const sourceFile = new SourceFile(
|
||||
this._fs,
|
||||
|
Loading…
Reference in New Issue
Block a user