Issue #12247 has been updated by Yui NARUSE.


With gcc version 5.3.0 20151204 (Ubuntu 5.3.0-3ubuntu1~14.04), following result:

```
%  time ./miniruby54488 -e'i=1000000;while (i-=1)>0;[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);end'
./miniruby54488   2.07s user 0.01s system 99% cpu 2.081 total
%  time ./miniruby54488 -e'i=1000000;while (i-=1)>0;[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);end'
./miniruby54488   2.08s user 0.00s system 99% cpu 2.082 total
%  time ./miniruby54488 -e'i=1000000;while (i-=1)>0;[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);end'
./miniruby54488   1.92s user 0.00s system 99% cpu 1.925 total
%  time ./miniruby54488 -e'i=1000000;while (i-=1)>0;[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);end'
./miniruby54488   1.95s user 0.00s system 99% cpu 1.957 total
%  time ./miniruby54488 -e'i=1000000;while (i-=1)>0;[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);end'
./miniruby54488   1.98s user 0.01s system 99% cpu 1.988 total

%  time ./miniruby -e'i=1000000;while (i-=1)>0;[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);end'
./miniruby   1.98s user 0.00s system 99% cpu 1.985 total
%  time ./miniruby -e'i=1000000;while (i-=1)>0;[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);end'
./miniruby   1.96s user 0.01s system 99% cpu 1.977 total
%  time ./miniruby -e'i=1000000;while (i-=1)>0;[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);end'
./miniruby   2.11s user 0.00s system 99% cpu 2.121 total
%  time ./miniruby -e'i=1000000;while (i-=1)>0;[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);end'
./miniruby   2.01s user 0.01s system 99% cpu 2.021 total
%  time ./miniruby -e'i=1000000;while (i-=1)>0;[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);end'
./miniruby   2.04s user 0.01s system 99% cpu 2.056 total
%  time ./miniruby -e'i=1000000;while (i-=1)>0;[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);end'
./miniruby   1.99s user 0.00s system 99% cpu 1.997 total
%  time ./miniruby -e'i=1000000;while (i-=1)>0;[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);end'
./miniruby   2.10s user 0.01s system 99% cpu 2.119 total
%  time ./miniruby -e'i=1000000;while (i-=1)>0;[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);[1,2,3,4,5].delete(1);end'
./miniruby   2.00s user 0.00s system 99% cpu 1.997 total
```

----------------------------------------
Feature #12247: accept multiple arguments at Array#delete
https://bugs.ruby-lang.org/issues/12247#change-57938

* Author: Usaku NAKAMURA
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
I found that it's very useful if `Array#delete` accepts multiple arguments.

```ruby
ary = [1, 2, 3, 4, 5]
ary.delete(1, 3)       #=> [1, 3]
ary                    #=> [2, 4, 5]
```

---Files--------------------------------
delete_multi.patch (4.6 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>