Skip to content

Commit 2d43968

Browse files
committed
Remove unnecessary null/empty check for vmType
Simplifies vmType handling by removing redundant string.IsNullOrEmpty checks before prefixing with 'global::'. This change assumes vmType is always non-null and non-empty at this point in the code.
1 parent 8a52b4a commit 2d43968

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ReactiveUI.SourceGenerators.Roslyn/IViewFor/IViewForGenerator.Execute.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public partial class IViewForGenerator
105105

106106
token.ThrowIfCancellationRequested();
107107

108-
// Get RegistrationType enum value from the attribute
108+
// Get ViewModelRegistrationType enum value from the attribute
109109
attributeData.TryGetNamedArgument("ViewModelRegistrationType", out int splatViewModelRegistrationType);
110110
var viewModelRegistrationType = splatViewModelRegistrationType switch
111111
{
@@ -352,7 +352,7 @@ private static string GenerateRegistrationExtensions(in ImmutableArray<IViewForI
352352
continue;
353353
}
354354

355-
if (!string.IsNullOrEmpty(vmType) && !vmType.StartsWith("global::", System.StringComparison.Ordinal))
355+
if (!vmType.StartsWith("global::", System.StringComparison.Ordinal))
356356
{
357357
vmType = "global::" + vmType;
358358
}
@@ -384,7 +384,7 @@ private static string GenerateRegistrationExtensions(in ImmutableArray<IViewForI
384384
continue;
385385
}
386386

387-
if (!string.IsNullOrEmpty(vmType) && !vmType.StartsWith("global::", System.StringComparison.Ordinal))
387+
if (!vmType.StartsWith("global::", System.StringComparison.Ordinal))
388388
{
389389
vmType = "global::" + vmType;
390390
}

0 commit comments

Comments
 (0)