Skip to content

Commit 1dca9d9

Browse files
committed
to drop
1 parent b743c9e commit 1dca9d9

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/NHibernate/Collection/Generic/PersistentGenericBag.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -295,15 +295,12 @@ public override bool EqualsSnapshot(ICollectionPersister persister)
295295
return false;
296296
}
297297

298-
for (var i = 0; i < _gbag.Count; i++)
298+
foreach (var elt in _gbag)
299299
{
300-
if(elementType.IsSame(_gbag[i], sn[i]))
301-
continue;
302-
303-
var elt = _gbag[i];
304-
var countInSnapshot = CountOccurrences(elt, sn, elementType);
305-
if (countInSnapshot == 0 || CountOccurrences(elt, _gbag, elementType) != countInSnapshot)
306-
return false;
300+
if (CountOccurrences(elt, _gbag, elementType) != CountOccurrences(elt, sn, elementType))
301+
{
302+
throw new HibernateException("Detected not equals snapshots");
303+
}
307304
}
308305

309306
return true;

0 commit comments

Comments
 (0)