From f18a30b669cee41b3ef16546d3e7b93a9fd937d0 Mon Sep 17 00:00:00 2001 From: Jeff Cyr Date: Thu, 20 Dec 2018 06:08:24 -0500 Subject: [PATCH] Use !IsEmpty instead of TryPeek (dotnet/corefx#34174) Commit migrated from https://github.com/dotnet/corefx/commit/4c95ab00fa17b61598d1f206dbe2643ede81b69b --- .../src/Common/System/Data/ProviderBase/DbConnectionPool.cs | 2 +- .../src/System/Data/ProviderBase/DbConnectionPool.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Data.Odbc/src/Common/System/Data/ProviderBase/DbConnectionPool.cs b/src/libraries/System.Data.Odbc/src/Common/System/Data/ProviderBase/DbConnectionPool.cs index a620b6e..05fae9b 100644 --- a/src/libraries/System.Data.Odbc/src/Common/System/Data/ProviderBase/DbConnectionPool.cs +++ b/src/libraries/System.Data.Odbc/src/Common/System/Data/ProviderBase/DbConnectionPool.cs @@ -673,7 +673,7 @@ namespace System.Data.ProviderBase Interlocked.Exchange(ref _pendingOpensWaiting, 0); } } - } while (_pendingOpens.TryPeek(out next)); + } while (!_pendingOpens.IsEmpty); } internal bool TryGetConnection(DbConnection owningObject, TaskCompletionSource retry, DbConnectionOptions userOptions, out DbConnectionInternal connection) diff --git a/src/libraries/System.Data.SqlClient/src/System/Data/ProviderBase/DbConnectionPool.cs b/src/libraries/System.Data.SqlClient/src/System/Data/ProviderBase/DbConnectionPool.cs index 13d41ba..62728f0 100644 --- a/src/libraries/System.Data.SqlClient/src/System/Data/ProviderBase/DbConnectionPool.cs +++ b/src/libraries/System.Data.SqlClient/src/System/Data/ProviderBase/DbConnectionPool.cs @@ -1021,7 +1021,7 @@ namespace System.Data.ProviderBase Interlocked.Exchange(ref _pendingOpensWaiting, 0); } } - } while (_pendingOpens.TryPeek(out next)); + } while (!_pendingOpens.IsEmpty); } internal bool TryGetConnection(DbConnection owningObject, TaskCompletionSource retry, DbConnectionOptions userOptions, out DbConnectionInternal connection) -- 2.7.4