Project

General

Profile

Actions

Bug #1440

closed

Array#flatten!(0) should return nil, not self

Added by marcandre (Marc-Andre Lafortune) about 13 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
ruby -v:
ruby 1.9.2dev (2009-05-06 trunk 23352) [i386-darwin9.6.0]
Backport:
[ruby-core:23382]

Description

=begin
As per doc, flatten!(0) does not make modifications and should thus return nil.

[].flatten! # ==> nil
[].flatten!(42) # ==> nil
[].flatten!(-1) # ==> nil
[].flatten!(0) # ==> []

Poor man's diff for "rb_ary_flatten_bang"

  • if (level == 0) return ary;
    
  • if (level == 0) return Qnil;
    

=end

Actions #1

Updated by nobu (Nobuyoshi Nakada) about 13 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r23361.
=end

Actions

Also available in: Atom PDF