We were calling RemoveAttr while ranging the slice
which would call a = append(a[:i], a[i+1:]...).
This incorrectly changes the array contents while the
slice range variable remains the same and therefore
incorrectly deleting the wrong attribute.
We fix this by properly implementing a slice filter in-place.
We were calling RemoveAttr while ranging the slice which would call
a = append(a[:i], a[i+1:]...)
. This incorrectly changes the array contents while the slice range variable remains the same and therefore incorrectly deleting the wrong attribute.We fix this by properly implementing a slice filter in-place.