Commit 7c29aa04 authored by mgravell's avatar mgravell

hashcode calc should be unchecked

parent bb3052fa
...@@ -106,10 +106,13 @@ internal Identity(string sql, IDbConnection cnn, Type type) ...@@ -106,10 +106,13 @@ internal Identity(string sql, IDbConnection cnn, Type type)
this.sql = sql; this.sql = sql;
this.connectionString = cnn.ConnectionString; this.connectionString = cnn.ConnectionString;
this.type = type; this.type = type;
hashCode = 17; // we *know* we are using this in a dictionary, so pre-compute this unchecked
hashCode = hashCode * 23 + (sql == null ? 0 : sql.GetHashCode()); {
hashCode = hashCode * 23 + (type == null ? 0 : type.GetHashCode()); hashCode = 17; // we *know* we are using this in a dictionary, so pre-compute this
hashCode = hashCode * 23 + (connectionString == null ? 0 : connectionString.GetHashCode()); hashCode = hashCode * 23 + (sql == null ? 0 : sql.GetHashCode());
hashCode = hashCode * 23 + (type == null ? 0 : type.GetHashCode());
hashCode = hashCode * 23 + (connectionString == null ? 0 : connectionString.GetHashCode());
}
} }
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment