From d646cc5697802fc06b62e33e50a8aa01bccc51ed Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Thu, 11 Jul 2019 20:28:09 -0400 Subject: [PATCH] Avoid loading resources for an SslStream exception never thrown (dotnet/corefx#39414) SslStream's cctor creates an ObjectDisposedException it uses as a sentinel, but this instance is never actually thrown. As such, we don't need to pay to load resources for it. Commit migrated from https://github.com/dotnet/corefx/commit/7055a28952ce82e79f93519a68025dc884545645 --- .../src/System/Net/Security/SslStream.Implementation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs index f20a5f9..43fdf85 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs @@ -64,7 +64,7 @@ namespace System.Net.Security private object _queuedReadStateRequest; /// Set as the _exception when the instance is disposed. - private static readonly ExceptionDispatchInfo s_disposedSentinel = ExceptionDispatchInfo.Capture(new ObjectDisposedException(nameof(SslStream))); + private static readonly ExceptionDispatchInfo s_disposedSentinel = ExceptionDispatchInfo.Capture(new ObjectDisposedException(nameof(SslStream), (string)null)); private void ThrowIfExceptional() { -- 2.7.4