diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-25 03:37:57 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-25 03:37:57 +0000 |
| commit | e4ca899610f4b681f8297b0ece0f3aae1fc6cfd7 (patch) | |
| tree | eec5c3147ee551b5802f06ea56dde2ce9d11c935 | |
| parent | a4e981bf047d4a14c09739a193d8cf421f0fca0a (diff) | |
| download | ruby-e4ca899610f4b681f8297b0ece0f3aae1fc6cfd7.tar.gz ruby-e4ca899610f4b681f8297b0ece0f3aae1fc6cfd7.tar.xz ruby-e4ca899610f4b681f8297b0ece0f3aae1fc6cfd7.zip | |
* array.c (flatten): returns an instance of same class.
[ruby-core:16554]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | array.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Fri Apr 25 12:37:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * array.c (flatten): returns an instance of same class. + [ruby-core:16554] + Fri Apr 25 10:52:27 2008 NAKAMURA Usaku <usa@ruby-lang.org> * include/ruby/win32.h: define mode_t for umask. @@ -2765,7 +2765,7 @@ flatten(VALUE ary, int level, int *modified) st_data_t id; stack = rb_ary_new(); - result = rb_ary_new(); + result = ary_new(rb_class_of(ary), RARRAY_LEN(ary)); memo = st_init_numtable(); st_insert(memo, (st_data_t)ary, (st_data_t)Qtrue); *modified = 0; |
