File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
src/Microsoft.Data.SqlClient
netcore/src/Common/src/Microsoft/Data/Common
netfx/src/Common/src/Microsoft/Data/Common Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -42,14 +42,12 @@ internal virtual string ConnectionString
4242
4343 public override bool Equals ( object obj )
4444 {
45- if ( obj == null || obj . GetType ( ) != typeof ( DbConnectionPoolKey ) )
45+ if ( obj == null )
4646 {
4747 return false ;
4848 }
4949
50- DbConnectionPoolKey key = obj as DbConnectionPoolKey ;
51-
52- return ( key != null && _connectionString == key . _connectionString ) ;
50+ return ( obj is DbConnectionPoolKey key && _connectionString == key . _connectionString ) ;
5351 }
5452
5553 public override int GetHashCode ( )
Original file line number Diff line number Diff line change @@ -43,14 +43,12 @@ internal virtual string ConnectionString
4343
4444 public override bool Equals ( object obj )
4545 {
46- if ( obj == null || obj . GetType ( ) != typeof ( DbConnectionPoolKey ) )
46+ if ( obj == null )
4747 {
4848 return false ;
4949 }
5050
51- DbConnectionPoolKey key = obj as DbConnectionPoolKey ;
52-
53- return ( key != null && _connectionString == key . _connectionString ) ;
51+ return ( obj is DbConnectionPoolKey key && _connectionString == key . _connectionString ) ;
5452 }
5553
5654 public override int GetHashCode ( )
You can’t perform that action at this time.
0 commit comments