summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-07 07:40:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-07 07:40:11 +0000
commit94ee3e7e0207eedac81b30444f72d5b51a7c2230 (patch)
tree1bc72beb3a030b837e5cab4819d82b438d63bf53 /array.c
parent2f164472392ada9858971da5900b8895e70fc6be (diff)
* array.c (rb_ary_flatten_bang): returns nil if nothing changed.
a patch from Marc-Andre Lafortune in [ruby-core:23382]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/array.c b/array.c
index 4eeae43391..034aa7fcf0 100644
--- a/array.c
+++ b/array.c
@@ -3338,7 +3338,7 @@ rb_ary_flatten_bang(int argc, VALUE *argv, VALUE ary)
rb_scan_args(argc, argv, "01", &lv);
if (!NIL_P(lv)) level = NUM2INT(lv);
- if (level == 0) return ary;
+ if (level == 0) return Qnil;
result = flatten(ary, level, &mod);
if (mod == 0) return Qnil;