Skip to content

Commit 8955bda

Browse files
committed
FindCodeModule is moot. made it return qualifiedName.Component.CodeModule
1 parent 59f785b commit 8955bda

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

RetailCoder.VBE/Extensions/VbeExtensions.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,7 @@ public static class VbeExtensions
99
{
1010
public static CodeModule FindCodeModule(this VBE vbe, QualifiedModuleName qualifiedName)
1111
{
12-
var vbComponent = vbe.VBProjects.Cast<VBProject>()
13-
.Where(project => project.Protection != vbext_ProjectProtection.vbext_pp_locked
14-
&& project.Equals(qualifiedName.Project))
15-
.SelectMany(project => project.VBComponents.Cast<VBComponent>())
16-
.SingleOrDefault(component => component.Equals(qualifiedName.Component));
17-
18-
return vbComponent == null
19-
? null
20-
: vbComponent.CodeModule;
12+
return qualifiedName.Component.CodeModule;
2113
}
2214

2315
public static void SetSelection(this VBE vbe, QualifiedSelection selection)

0 commit comments

Comments
 (0)