Skip to content

Commit f3487e3

Browse files
hazzikfredericDelaporte
authored andcommitted
Optimize ProxyCacheEntry for the same instance
1 parent f7f783e commit f3487e3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/NHibernate/Proxy/ProxyCacheEntry.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ public override bool Equals(object obj)
5353

5454
public bool Equals(ProxyCacheEntry other)
5555
{
56+
if (ReferenceEquals(this, other))
57+
return true;
58+
5659
if (ReferenceEquals(null, other) ||
5760
// hashcode inequality allows an early exit, but their equality is not enough for guaranteeing instances equality.
5861
_hashCode != other._hashCode ||

0 commit comments

Comments
 (0)