Skip to content

Commit 41770d3

Browse files
committed
Fixed [severe] inspection performance issue
1 parent 0182a65 commit 41770d3

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

RetailCoder.VBE/Inspections/InspectionNames.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

RetailCoder.VBE/Inspections/InspectionNames.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
<value>Instruction contains multiple declarations</value>
143143
</data>
144144
<data name="NonReturningFunction_" xml:space="preserve">
145-
<value>Function '{0}' returns no value</value>
145+
<value>Return value for member '{0}' is never assigned</value>
146146
</data>
147147
<data name="ObsoleteCall" xml:space="preserve">
148148
<value>Use of obsolete Call statement</value>

RetailCoder.VBE/Inspections/ParameterCanBeByValInspection.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public ParameterCanBeByValInspection()
3636
public IEnumerable<CodeInspectionResultBase> GetInspectionResults(VBProjectParseResult parseResult)
3737
{
3838
var interfaceMembers = parseResult.Declarations.FindInterfaceMembers()
39-
.Concat(parseResult.Declarations.FindInterfaceImplementationMembers());
39+
.Concat(parseResult.Declarations.FindInterfaceImplementationMembers())
40+
.ToList();
4041

4142
var issues = parseResult.Declarations.Items.Where(declaration =>
4243
declaration.DeclarationType == DeclarationType.Parameter

Rubberduck.Parsing/Symbols/Declarations.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ public IEnumerable<Declaration> FindInterfaceMembers()
7575
.ToList();
7676

7777
_interfaceMembers = _declarations.Where(item => ProcedureTypes.Contains(item.DeclarationType)
78-
&& interfaces.Any(i => item.ParentScope.StartsWith(i)));
78+
&& interfaces.Any(i => item.ParentScope.StartsWith(i)))
79+
.ToList();
7980
return _interfaceMembers;
8081
}
8182

@@ -93,7 +94,8 @@ public IEnumerable<Declaration> FindInterfaceImplementationMembers()
9394

9495
var members = FindInterfaceMembers();
9596
_interfaceImplementationMembers = _declarations.Where(item => ProcedureTypes.Contains(item.DeclarationType)
96-
&& members.Select(m => m.ComponentName + '_' + m.IdentifierName).Contains(item.IdentifierName));
97+
&& members.Select(m => m.ComponentName + '_' + m.IdentifierName).Contains(item.IdentifierName))
98+
.ToList();
9799

98100
return _interfaceImplementationMembers;
99101
}

Rubberduck.sln

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ Project("{6141683F-8A12-4E36-9623-2EB02B2C2303}") = "Rubberduck.Setup32", "Setup
1919
EndProject
2020
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rubberduck.Parsing", "Rubberduck.Parsing\Rubberduck.Parsing.csproj", "{A4A618E1-CBCA-435F-9C6C-5181E030ADFC}"
2121
EndProject
22+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{07952BD8-646C-4494-965C-E80F3CDE3485}"
23+
ProjectSection(SolutionItems) = preProject
24+
Performance1.psess = Performance1.psess
25+
EndProjectSection
26+
EndProject
2227
Global
2328
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2429
CD_ROM|Any CPU = CD_ROM|Any CPU
@@ -254,4 +259,7 @@ Global
254259
GlobalSection(SolutionProperties) = preSolution
255260
HideSolutionNode = FALSE
256261
EndGlobalSection
262+
GlobalSection(Performance) = preSolution
263+
HasPerformanceSessions = true
264+
EndGlobalSection
257265
EndGlobal

0 commit comments

Comments
 (0)