Skip to content

Commit

Permalink
Remove redundant DbConnectionPoolKey Get Type (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored Apr 8, 2020
1 parent 7ec2095 commit b408929
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,12 @@ internal virtual string ConnectionString

public override bool Equals(object obj)
{
if (obj == null || obj.GetType() != typeof(DbConnectionPoolKey))
if (obj == null)
{
return false;
}

DbConnectionPoolKey key = obj as DbConnectionPoolKey;

return (key != null && _connectionString == key._connectionString);
return (obj is DbConnectionPoolKey key && _connectionString == key._connectionString);
}

public override int GetHashCode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,12 @@ internal virtual string ConnectionString

public override bool Equals(object obj)
{
if (obj == null || obj.GetType() != typeof(DbConnectionPoolKey))
if (obj == null)
{
return false;
}

DbConnectionPoolKey key = obj as DbConnectionPoolKey;

return (key != null && _connectionString == key._connectionString);
return (obj is DbConnectionPoolKey key && _connectionString == key._connectionString);
}

public override int GetHashCode()
Expand Down

0 comments on commit b408929

Please sign in to comment.