From: stephane@...
Date: 2016-01-07T09:19:38+00:00
Subject: [ruby-core:72758] [Ruby trunk - Bug #11961] Array#delete_if gets an unexpected behavior when Array is modified during execution
Issue #11961 has been updated by St��phane Cl��rambault.
Subject changed from Array#delete_if get an expected behavior when Array in modified during treatment to Array#delete_if gets an unexpected behavior when Array is modified during execution
----------------------------------------
Bug #11961: Array#delete_if gets an unexpected behavior when Array is modified during execution
https://bugs.ruby-lang.org/issues/11961#change-56004
* Author: St��phane Cl��rambault
* Status: Open
* Priority: Normal
* Assignee: Nobuyoshi Nakada
* ruby -v: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
However strange is the code below the behavior is not which expected.
a = %w(aue)
a.delete_if { a.delete_if { true }; true}
p a
with ruby 2.3 it produces:
["aue", false, false]
with ruby 2.2 it procudes:
[]
After a git bisect I found 5ec029d1ea52224a365a11987379c3e9de74b47a (r49255) commit for feature #10714 as possible culprit.
--
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>