2007-10-10 Juraj Skripsky <js@hotfeet.ch>
* Dictionary.cs (Enumerator.MoveNext): Handle the case where we
had already reached the end. Fixes bug #332534.
svn path=/trunk/mcs/; revision=88534
+2007-10-10 Juraj Skripsky <js@hotfeet.ch>
+
+ * Dictionary.cs (Enumerator.MoveNext): Handle the case where we
+ had already reached the end. Fixes bug #332534.
+
2007-08-20 Jb Evain <jbevain@novell.com>
* List.cs (AddCollection): return early if the collection
do {
if (cur == NO_SLOT) {
//move to next item in table, check if we reached the end
- if (++curTableItem == dictionary.table.Length)
+ if (++curTableItem >= dictionary.table.Length)
return false;
cur = dictionary.table [curTableItem] - 1;
Assert.IsNull(d[2]);
Assert.IsNull(d["foo"]);
}
+
+ // Bug: #332534
+ [Test]
+ public void Dictionary_MoveNext ()
+ {
+ Dictionary<int,int> a = new Dictionary<int,int>();
+ a.Add(3,1);
+ a.Add(4,1);
+
+ IEnumerator en = a.GetEnumerator();
+ for (int i = 1; i < 10; i++)
+ en.MoveNext();
+ }
+
}
}