Skip to content

Commit 765e1ed

Browse files
authored
Removed persistent collections Equals/GetHashCode overrides (#2461)
1 parent 74ff7a1 commit 765e1ed

File tree

3 files changed

+0
-51
lines changed

3 files changed

+0
-51
lines changed

src/NHibernate/Collection/Generic/PersistentGenericList.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -238,23 +238,6 @@ public override bool EntryExists(object entry, int i)
238238
return entry != null;
239239
}
240240

241-
public override bool Equals(object obj)
242-
{
243-
var that = obj as ICollection<T>;
244-
if (that == null)
245-
{
246-
return false;
247-
}
248-
Read();
249-
return CollectionHelper.SequenceEquals(WrappedList, that);
250-
}
251-
252-
public override int GetHashCode()
253-
{
254-
Read();
255-
return WrappedList.GetHashCode();
256-
}
257-
258241
#region IList Members
259242

260243
int IList.Add(object value)

src/NHibernate/Collection/Generic/PersistentGenericMap.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -230,23 +230,6 @@ public override object GetSnapshotElement(object entry, int i)
230230
return sn[((KeyValuePair<TKey, TValue>)entry).Key];
231231
}
232232

233-
public override bool Equals(object other)
234-
{
235-
var that = other as IDictionary<TKey, TValue>;
236-
if (that == null)
237-
{
238-
return false;
239-
}
240-
Read();
241-
return CollectionHelper.DictionaryEquals(WrappedMap, that);
242-
}
243-
244-
public override int GetHashCode()
245-
{
246-
Read();
247-
return WrappedMap.GetHashCode();
248-
}
249-
250233
public override bool EntryExists(object entry, int i)
251234
{
252235
return WrappedMap.ContainsKey(((KeyValuePair<TKey, TValue>)entry).Key);

src/NHibernate/Collection/Generic/PersistentGenericSet.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -277,23 +277,6 @@ public override object GetSnapshotElement(object entry, int i)
277277
throw new NotSupportedException("Sets don't support updating by element");
278278
}
279279

280-
public override bool Equals(object other)
281-
{
282-
var that = other as ISet<T>;
283-
if (that == null)
284-
{
285-
return false;
286-
}
287-
Read();
288-
return WrappedSet.SequenceEqual(that);
289-
}
290-
291-
public override int GetHashCode()
292-
{
293-
Read();
294-
return WrappedSet.GetHashCode();
295-
}
296-
297280
public override bool EntryExists(object entry, int i)
298281
{
299282
return true;

0 commit comments

Comments
 (0)