mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* hash.c (rb_hash_flatten): do not flatten recursively by default.
[ruby-dev:33603] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fe923029df
commit
acc1a53744
2 changed files with 10 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Wed Feb 6 01:47:39 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* hash.c (rb_hash_flatten): do not flatten recursively by default.
|
||||
[ruby-dev:33603]
|
||||
|
||||
Wed Feb 6 00:50:19 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* insns.def (adjuststack): never use INC_SP with minus value because
|
||||
|
|
5
hash.c
5
hash.c
|
@ -1673,6 +1673,11 @@ rb_hash_flatten(int argc, VALUE *argv, VALUE hash)
|
|||
VALUE ary;
|
||||
|
||||
ary = rb_hash_to_a(hash);
|
||||
if (argc == 0) {
|
||||
argc = 1;
|
||||
tmp = INT2FIX(1);
|
||||
argv = &tmp;
|
||||
}
|
||||
rb_funcall2(ary, rb_intern("flatten!"), argc, argv);
|
||||
return ary;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue