Skip to content

Commit 49628f3

Browse files
committed
Removed lock
1 parent b49a62a commit 49628f3

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

Rubberduck.Parsing/Symbols/DeclarationFinder.cs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -750,21 +750,16 @@ private ConcurrentBag<Declaration> FindEventHandlers(IEnumerable<Declaration> de
750750

751751
public IEnumerable<Declaration> GetDeclarationsAccessibleToScope(Declaration target, IEnumerable<Declaration> declarations)
752752
{
753-
754-
object obj = new object();
755-
lock (obj)
756-
{
757-
if (target == null) { return Enumerable.Empty<Declaration>(); }
758-
759-
return declarations
760-
.Where(candidateDeclaration =>
761-
(
762-
IsDeclarationInTheSameProcedure(candidateDeclaration, target)
763-
|| IsDeclarationChildOfTheScope(candidateDeclaration, target)
764-
|| IsModuleLevelDeclarationOfTheScope(candidateDeclaration, target)
765-
|| IsProjectGlobalDeclaration(candidateDeclaration, target)
766-
)).Distinct();
767-
}
753+
if (target == null) { return Enumerable.Empty<Declaration>(); }
754+
755+
return declarations
756+
.Where(candidateDeclaration =>
757+
(
758+
IsDeclarationInTheSameProcedure(candidateDeclaration, target)
759+
|| IsDeclarationChildOfTheScope(candidateDeclaration, target)
760+
|| IsModuleLevelDeclarationOfTheScope(candidateDeclaration, target)
761+
|| IsProjectGlobalDeclaration(candidateDeclaration, target)
762+
)).Distinct();
768763
}
769764

770765
private bool IsDeclarationInTheSameProcedure(Declaration candidateDeclaration, Declaration scopingDeclaration)

0 commit comments

Comments
 (0)