I’m thinking of doing the following:
for(LinkedListNode<MyClass> it = myCollection.First; it != null; it = it.Next)
{
if(it.Value.removalCondition == true)
it.Value = null;
}
What I’m wondering is: if simply pointing the it.Value to null actually gets rid of it.
Surely (with a linked list) you need to change the link.
Eg, if you want to remove B from the LL A-B-C, you need to change A’s link to B to C.
I’ll admit I’m not familiar with the .NET implementation of linked lists but hopefully that’s a start for you.