Re: SortedList bug?
From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 10/14/04
- Next message: KK: "Creating Forms control using Activator"
- Previous message: marcus å: "Re: Namespace"
- In reply to: Jose Jarabo: "SortedList bug?"
- Next in thread: Jose Jarabo: "Re: SortedList bug?"
- Reply: Jose Jarabo: "Re: SortedList bug?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 14 Oct 2004 08:28:07 +0100
Jose Jarabo <JoseJarabo@discussions.microsoft.com> wrote:
> I am not sure how to categorize this, either a bug or something else but
> here is my problem.
>
> I am testing with 2 elements on a sorted list. If I remove the last element
> on the list everything works fine and I can add other elements to it. However
> if I remove the first element on the list and I try to add something then my
> first element is changed when I add a new element to that new element.
> Here is how im adding elements
>
> SomeDataType newlement = new SomeDataType();
> SomeSortedList[SomeSortedList.Count] = newelement;
>
> this is how I remove them.
>
> SomeSortedList.RemoveAt(index);
>
> I have reviewed the code over and over and the element is being correctly
> removed but apparently when the list is resorted a pointer to the element
> that moved to the empty spot remains in its original spot..
>
> Maybe im wrong and that hit i took to the head earlier has me spinning.
> Anyways if anyone can tell me.. please let me know.
Could you post a short but complete program which demonstrates the
problem?
See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
-- Jon Skeet - <skeet@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
- Next message: KK: "Creating Forms control using Activator"
- Previous message: marcus å: "Re: Namespace"
- In reply to: Jose Jarabo: "SortedList bug?"
- Next in thread: Jose Jarabo: "Re: SortedList bug?"
- Reply: Jose Jarabo: "Re: SortedList bug?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|