From: hanmac@... Date: 2018-07-05T07:28:14+00:00 Subject: [ruby-core:87805] [Ruby trunk Feature#14887] Array#delete_if does not use #delete Issue #14887 has been updated by Hanmac (Hans Mackowiak). @shevegen : the problem is that: * `delete_if` can't call `delete` for the given reason of duplicates. the example with `with_index` was only an example to show where it differ. * `delete_if` can't call `delete_at` because it would cause massive array resize inbetween. i also don't know if the index would be handled right there ---------------------------------------- Feature #14887: Array#delete_if does not use #delete https://bugs.ruby-lang.org/issues/14887#change-72822 * Author: sdaubert (Sylvain Daubert) * Status: Open * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) * Target version: ---------------------------------------- When a class inherits from Array, and its #delete methods is modified, #delete_if and #reject! do not call this method. From sources, its an internal C method which is called instead. Is there a way to modify #delete_if and #reject! to use #delete? This would ease inheriting of Array class. -- https://bugs.ruby-lang.org/ Unsubscribe: