Skip to content

Commit 05f6269

Browse files
refactor: replace RegexUtils.MatchNamespaces with inline StartsWith
The RegexUtils.MatchNamespaces helper simply delegates to string.StartsWith. Inline the check directly in ArchBuilder to remove an unnecessary indirection. The remaining RegexUtils methods (MatchGetPropertyName, MatchSetPropertyName) are still in use. Signed-off-by: Alexander Linne <alexander.linne@tngtech.com>
1 parent 282e144 commit 05f6269

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

ArchUnitNET/Loader/ArchBuilder.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ public void LoadTypesForModule(ModuleDefinition module, string namespaceFilter)
9090
var currentTypes = new List<IType>(types.Count);
9191
types
9292
.Where(typeDefinition =>
93-
RegexUtils.MatchNamespaces(namespaceFilter, typeDefinition.Namespace)
93+
(
94+
namespaceFilter == null
95+
|| typeDefinition.Namespace.StartsWith(namespaceFilter)
96+
)
9497
&& typeDefinition.CustomAttributes.All(att =>
9598
att.AttributeType.FullName
9699
!= "Microsoft.VisualStudio.TestPlatform.TestSDKAutoGeneratedCode"

0 commit comments

Comments
 (0)