diff options
Diffstat (limited to 'src/System.Private.CoreLib/shared/System/IO/MemoryStream.cs')
-rw-r--r-- | src/System.Private.CoreLib/shared/System/IO/MemoryStream.cs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/System.Private.CoreLib/shared/System/IO/MemoryStream.cs b/src/System.Private.CoreLib/shared/System/IO/MemoryStream.cs index 8ca162b57c..b9f2b5e35f 100644 --- a/src/System.Private.CoreLib/shared/System/IO/MemoryStream.cs +++ b/src/System.Private.CoreLib/shared/System/IO/MemoryStream.cs @@ -527,8 +527,7 @@ namespace System.IO return Task.CompletedTask; // If destination is not a memory stream, write there asynchronously: - MemoryStream memStrDest = destination as MemoryStream; - if (memStrDest == null) + if (!(destination is MemoryStream memStrDest)) return destination.WriteAsync(_buffer, pos, n, cancellationToken); try |