Have you tried it without `dup`? As it's not a `delete_if!` it shouldn't manipulate the object.