Skip to content

Commit f9b2257

Browse files
Fix TypedValue hash-code colliding too easily
1 parent f26d29b commit f9b2257

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/NHibernate/Engine/TypedValue.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ private int GetHashCode(IType type, IEnumerable values)
9696

9797
unchecked
9898
{
99-
int result = 0;
99+
var result = 19;
100100

101101
foreach (object obj in values)
102-
result += obj == null ? 0 : type.GetHashCode(obj);
102+
result = 37 * result + (obj == null ? 0 : type.GetHashCode(obj));
103103

104104
return result;
105105
}

0 commit comments

Comments
 (0)