mrAsadi / jabber-net

Automatically exported from code.google.com/p/jabber-net
Other
0 stars 0 forks source link

ParticipantCollection.GetHashCode() - deep algorithm #57

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The ParticipantCollection's GetHashCode() doesn't get updated as
participants join and leave. This is (IMO) a bug in the .NET collections,
as Hashtable and IDictionary exhibit the same behavior. I understand that
handling OnParticipantJoin and OnParticipantLeave are preferred ways to
handle changes in the ParticipantCollection, however; for stateless
applications, its handy to store a reference the hashCode and simply
compare it later to see if anything has changed.

Attached is a sample implementation that should work for any ICollection
implementation.

Original issue reported on code.google.com by bluesbre...@gmail.com on 6 Jan 2009 at 4:35

Attachments:

GoogleCodeExporter commented 9 years ago
No this is not a bug in .NET collections. Have you read

http://msdn.microsoft.com/en-us/library/system.object.gethashcode.aspx ?

Secondly IDictionary does not exhibit a behavior. It is an interface.

Original comment by michel.y...@vtxmail.ch on 6 May 2009 at 6:50