You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the method RemoveNodesInProject, the code iterates using an index over an array from which elements are deleted. When element 2 is deleted, the element 3 becomes element 2. As the indexer is always incremented, the next item considered is element 3 meaning the old element 3 (now 2) is skipped.
Fixed code:
- for (var i = 0; i < item.ChildNodes.Count; i++)
+ for (var i = 0; i < item.ChildNodes.Count; )
{
if (_isCancel)
break;
if (_nodesToRemove.Any(x => x.Attributes[0].Value == item.ChildNodes[i].Attributes[0].Value))
item.RemoveChild(item.ChildNodes[i]);
+ else
+ i++;
}
The text was updated successfully, but these errors were encountered:
In the method RemoveNodesInProject, the code iterates using an index over an array from which elements are deleted. When element 2 is deleted, the element 3 becomes element 2. As the indexer is always incremented, the next item considered is element 3 meaning the old element 3 (now 2) is skipped.
Fixed code:
The text was updated successfully, but these errors were encountered: