Skip to content

Commit 16a406e

Browse files
committed
Remove content hash from the QMN
Calculating the content hash of the module on creating of a QMN is actively hurting their usability in hot-paths. The content hash was not really used and only was left there because it seemed to prevent some strange behaviour of COM components. Testing, I did no longer run into the strange behaviour. So, I think it is prudent to remove the content hash.
1 parent de6f994 commit 16a406e

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

Rubberduck.VBEEditor/QualifiedModuleName.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,13 @@ public QualifiedModuleName(IVBProject project)
4848
_projectName = project.Name;
4949
ProjectPath = string.Empty;
5050
ProjectId = GetProjectId(project);
51-
ModuleContentHashOnCreation = GetContentHash(null);
5251
}
5352

5453
public QualifiedModuleName(IVBComponent component)
5554
{
5655
ComponentType = component.Type;
5756
_componentName = component.IsWrappingNullReference ? string.Empty : component.Name;
5857

59-
//note: We set this property in order to stabelize the component.
60-
//For some reason, components sometimes seem to get removed on the COM side although
61-
//an RCW is still holding a reference. For some reason, opening the CodeModule of a
62-
//component seems to prevent this.
63-
//This is a hack to open the code module on each component for which we get a QMN
64-
//in a way that does not get optimized away.
65-
ModuleContentHashOnCreation = GetContentHash(component);
66-
6758
using (var components = component.Collection)
6859
{
6960
using (var project = components.Parent)
@@ -96,7 +87,6 @@ public QualifiedModuleName(string projectName, string projectPath, string compon
9687
ProjectId = "External" + $"{_projectName};{ProjectPath}".GetHashCode().ToString(CultureInfo.InvariantCulture);
9788
_componentName = componentName;
9889
ComponentType = ComponentType.ComComponent;
99-
ModuleContentHashOnCreation = GetContentHash(null);
10090
}
10191

10292
public QualifiedMemberName QualifyMemberName(string member)
@@ -118,7 +108,6 @@ public QualifiedMemberName QualifyMemberName(string member)
118108
public string ProjectName => _projectName ?? string.Empty;
119109

120110
public string ProjectPath { get; }
121-
public int ModuleContentHashOnCreation { get; }
122111

123112
public override string ToString()
124113
{

0 commit comments

Comments
 (0)