Skip to content

Commit 905307f

Browse files
committed
Minor codegen improvements
1 parent 47f495c commit 905307f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Microsoft.Toolkit.Mvvm/Input/AsyncRelayCommand{T}.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public bool CanExecute(T? parameter)
131131
[MethodImpl(MethodImplOptions.AggressiveInlining)]
132132
public bool CanExecute(object? parameter)
133133
{
134-
if (typeof(T).IsValueType &&
134+
if (default(T) is not null &&
135135
parameter is null &&
136136
this.canExecute is null)
137137
{

Microsoft.Toolkit.Mvvm/Input/RelayCommand{T}.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public bool CanExecute(T? parameter)
7676
/// <inheritdoc/>
7777
public bool CanExecute(object? parameter)
7878
{
79-
if (typeof(T).IsValueType &&
79+
if (default(T) is not null &&
8080
parameter is null &&
8181
this.canExecute is null)
8282
{

0 commit comments

Comments
 (0)