Skip to content

Commit 7fa90f6

Browse files
authored
Use pattern matching in TaskExtensions (#4424)
1 parent 4dfe586 commit 7fa90f6

File tree

1 file changed

+1
-2
lines changed
  • src/Microsoft.DotNet.Wpf/src/System.Windows.Presentation/System/Windows/Threading

1 file changed

+1
-2
lines changed

src/Microsoft.DotNet.Wpf/src/System.Windows.Presentation/System/Windows/Threading/TaskExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ public static class TaskExtensions
1616
/// </summary>
1717
public static bool IsDispatcherOperationTask(this Task @this)
1818
{
19-
var mapping = @this.AsyncState as DispatcherOperationTaskMapping;
20-
return mapping != null;
19+
return @this.AsyncState is DispatcherOperationTaskMapping;
2120
}
2221

2322
/// <summary>

0 commit comments

Comments
 (0)