From 68f7bfe25f746a3ffe954b4e08d2df878a452a50 Mon Sep 17 00:00:00 2001 From: David Michon Date: Fri, 12 Aug 2022 15:49:27 -0700 Subject: [PATCH] Remove double lookup --- libraries/rush-lib/src/logic/ProjectChangeAnalyzer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/rush-lib/src/logic/ProjectChangeAnalyzer.ts b/libraries/rush-lib/src/logic/ProjectChangeAnalyzer.ts index 0ed7f704a23..da0f2cd2413 100644 --- a/libraries/rush-lib/src/logic/ProjectChangeAnalyzer.ts +++ b/libraries/rush-lib/src/logic/ProjectChangeAnalyzer.ts @@ -376,11 +376,11 @@ export class ProjectChangeAnalyzer { let i: number = 0; for (const projectDeps of projectHashDeps.values()) { const projectDependencyManifestPath: string = projectDependencyManifestPaths[i]; - if (!hashes.has(projectDependencyManifestPath)) { + const hash: string | undefined = hashes.get(projectDependencyManifestPath); + if (hash === undefined) { throw new InternalError(`Expected to get a hash for ${projectDependencyManifestPath}`); } - const hash: string = hashes.get(projectDependencyManifestPath)!; projectDeps.set(projectDependencyManifestPath, hash); i++; }