[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pnet-developers] [bugs #10335] Enumerator problem with SortedList.Keys
From: |
Gopal.V |
Subject: |
[Pnet-developers] [bugs #10335] Enumerator problem with SortedList.Keys |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040206 Firefox/0.8 |
This mail is an automated notification from the bugs tracker
of the project: DotGNU Portable.NET.
/**************************************************************************/
[bugs #10335] Latest Modifications:
Changes by:
Gopal.V <address@hidden>
'Date:
Thu 09/09/2004 at 14:24 (Asia/Calcutta)
What | Removed | Added
---------------------------------------------------------------------------
Resolution | None | Fixed
Status | Open | Closed
------------------ Additional Follow-up Comments ----------------------------
Patch #3355 applied to CVS fixes this.
/**************************************************************************/
[bugs #10335] Full Item Snapshot:
URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=10335>
Project: DotGNU Portable.NET
Submitted by: Dominique Canazzi
On: Thu 09/09/2004 at 13:39
Category: None
Severity: 5 - Average
Item Group: None
Resolution: Fixed
Privacy: Public
Assigned to: None
Status: Closed
Summary: Enumerator problem with SortedList.Keys
Original Submission: foreach(), applied to the ICollection returned by the
Keys property of a SortedList, loses the first key.
Example:
using System;
using System.Collections;
namespace sl
{
class Class1
{
static void Main()
{
SortedList sl = new SortedList ();
sl.Add ("xxx", 1);
sl.Add ("aaa", 2);
sl.Add ("qqq", 3);
sl.Add ("hhh", 4);
foreach (String s in sl.Keys)
{
Console.WriteLine (s + " " + sl[s]);
}
Console.WriteLine ("---------------------------------");
IList kl = sl.GetKeyList ();
IList vl = sl.GetValueList ();
for (int i=0; i<sl.Count; i++)
{
Console.WriteLine (kl[i] + " " + vl[i]);
}
}
}
}
Should output:
aaa 2
hhh 4
qqq 3
xxx 1
---------------------------------
aaa 2
hhh 4
qqq 3
xxx 1
but outputs:
hhh 4
qqq 3
xxx 1
---------------------------------
aaa 2
hhh 4
qqq 3
xxx 1
Sorry for not proposing a fix, the pnetlib code is still a bit puzzling for me
:)
Follow-up Comments
------------------
-------------------------------------------------------
Date: Thu 09/09/2004 at 14:24 By: Gopal.V <t3rmin4t0r>
Patch #3355 applied to CVS fixes this.
For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=10335>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/