Fix HashSet<>-related parts of #491858, #517415
authorRaja R Harinath <harinath@hurrynot.org>
Thu, 30 Jul 2009 17:49:41 +0000 (17:49 -0000)
committerRaja R Harinath <harinath@hurrynot.org>
Thu, 30 Jul 2009 17:49:41 +0000 (17:49 -0000)
commit16b5f90d639550195102c21912aabd4f484aecfb
tree09cca717441dfeea899c47578b7263d1302a255b
parente08e9acfcc514f06b917dc70025878a4d2ba79e8
Fix HashSet<>-related parts of #491858, #517415

* System.Collections.Generic/HashSet.cs (Enumerator.next): Rename from
Enumerator.current and change meaning to be the index of the slot to start
searching on the next iteration.
(Enumerator.current): New.  Contains the current element.
(Enumerator.MoveNext): Update.  Avoid an out-of-bounds access.
(Enumerator.Current): Don't check any invariants.
* Test/System.Collections.Generic/HashSetTest.cs (Enumerate_Current):
New test, including cases from #491858, #517415.

svn path=/trunk/mcs/; revision=139105
mcs/class/System.Core/System.Collections.Generic/ChangeLog
mcs/class/System.Core/System.Collections.Generic/HashSet.cs
mcs/class/System.Core/Test/System.Collections.Generic/ChangeLog
mcs/class/System.Core/Test/System.Collections.Generic/HashSetTest.cs