Skip to content

Commit 61553f6

Browse files
committed
Use pattern matching rather than null checking
1 parent 3c85111 commit 61553f6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

B9PartSwitch/Extensions/PartModuleExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ public static string LogTagString(this PartModule module)
1515
{
1616
string info = module.GetType().Name;
1717

18-
CustomPartModule utilModule = module as CustomPartModule;
19-
if (utilModule.IsNotNull() && !utilModule.moduleID.IsNullOrEmpty())
18+
if (module is CustomPartModule utilModule && !utilModule.moduleID.IsNullOrEmpty())
2019
info += $" '{utilModule.moduleID}'";
2120

2221
return $"[{info}]";

0 commit comments

Comments
 (0)