Skip to content

Commit 04510b5

Browse files
committed
Stop adding super type names for documents that are already there
This fixes a small memory leak in the reference resolver. Although the supertypes of a class declaration are a hash set, the super type names are a list. So, adding all supertype names derived from the typeLib API every parse would grow that list unnecessarily.
1 parent 1e9d244 commit 04510b5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Rubberduck.Parsing/VBA/ReferenceManagement/ReferenceResolveRunnerBase.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ private void AddSuperTypeNamesForDocumentModules(IReadOnlyCollection<QualifiedMo
191191

192192
foreach (var superTypeName in superTypeNames)
193193
{
194+
if (document.SupertypeNames.Contains(superTypeName))
195+
{
196+
continue;
197+
}
198+
194199
document.AddSupertypeName(superTypeName);
195200
}
196201
}

0 commit comments

Comments
 (0)