Fixed delete bug

This commit is contained in:
Mike Farah
2021-02-11 10:58:40 +11:00
parent 3a464272d4
commit 10600dd29a
2 changed files with 18 additions and 2 deletions
+2 -2
View File
@@ -13,8 +13,8 @@ func deleteChildOperator(d *dataTreeNavigator, context Context, expressionNode *
if err != nil {
return Context{}, err
}
for el := nodesToDelete.MatchingNodes.Front(); el != nil; el = el.Next() {
//need to iterate backwards to ensure correct indices when deleting multiple
for el := nodesToDelete.MatchingNodes.Back(); el != nil; el = el.Prev() {
candidate := el.Value.(*CandidateNode)
deleteImmediateChildOp := &Operation{