I want remove some items in a mutable array, But I don’t find the remove
or some functions in Array base library.
And I find some examples:
// Clear to-do item utility
public func clear(todos: [ToDo]) : [ToDo] {
var updated : [ToDo] = [];
for (todo : ToDo in todos.vals()) {
if (not todo.completed) {
updated := Array.append<ToDo>(updated, [todo]);
};
};
updated
};
This is by creating a new array and copying all the elements except to the be deleted one into the new array. is this will result in poor performance for relatively large arrays?