D_Guidi
06-21-2005, 10:48 PM
Hello to all.
For my project i should use a LinkedList, and developing with VS2005 i have used Generic LinkedList<T>.
My code seems similar to
LinkedList<T> list = new LinkedList<T>;
list.addlast(someObject);
while (nodeQueue.Count != 0)
{
object o = list.First;
list.RemoveFirst;
// Some work
if(condition)
list.addlast(someOtherObject);
}
Using Spring.Collections.LinkedList instead of FW2.0 GenericLinkedList, i have written this code:
LinkedList list = new LinkedList;
list.add(someObject);
while (nodeQueue.Count != 0)
{
object o = list[0];
list.RemoveAt(0);
// Some work
if(condition)
list.add(someOtherObject);
}
But i have found an error (maybe a bug?):
when condition == true, list.Count is correctly 1 (otherwise is 0 because i insert only one object and i remove immediately the object ) but, when i call list[0] the second time, the object returned is null!
I have checked the code, and the property Value for the Nde returned is null... some suggestions?
I could post entire souce code if someone is interested.
Thanks for interest.
For my project i should use a LinkedList, and developing with VS2005 i have used Generic LinkedList<T>.
My code seems similar to
LinkedList<T> list = new LinkedList<T>;
list.addlast(someObject);
while (nodeQueue.Count != 0)
{
object o = list.First;
list.RemoveFirst;
// Some work
if(condition)
list.addlast(someOtherObject);
}
Using Spring.Collections.LinkedList instead of FW2.0 GenericLinkedList, i have written this code:
LinkedList list = new LinkedList;
list.add(someObject);
while (nodeQueue.Count != 0)
{
object o = list[0];
list.RemoveAt(0);
// Some work
if(condition)
list.add(someOtherObject);
}
But i have found an error (maybe a bug?):
when condition == true, list.Count is correctly 1 (otherwise is 0 because i insert only one object and i remove immediately the object ) but, when i call list[0] the second time, the object returned is null!
I have checked the code, and the property Value for the Nde returned is null... some suggestions?
I could post entire souce code if someone is interested.
Thanks for interest.