diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-11-05 14:25:01 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-11-05 14:29:26 +0900 |
| commit | d9bd77b180a6f9832d5a016af0be29e3399bd8b1 (patch) | |
| tree | f262b7de5ae7321978e0c78c805b3eccf53028d4 /mrbgems/mruby-array-ext | |
| parent | 4e535080dc56bf803bae563abd8baf28b976cdd7 (diff) | |
| download | mruby-d9bd77b180a6f9832d5a016af0be29e3399bd8b1.tar.gz mruby-d9bd77b180a6f9832d5a016af0be29e3399bd8b1.zip | |
Fix `A.new([[1,2],3]).flatten` to return `Array`.
Diffstat (limited to 'mrbgems/mruby-array-ext')
| -rw-r--r-- | mrbgems/mruby-array-ext/mrblib/array.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-array-ext/mrblib/array.rb b/mrbgems/mruby-array-ext/mrblib/array.rb index f3246af4f..25669a9ab 100644 --- a/mrbgems/mruby-array-ext/mrblib/array.rb +++ b/mrbgems/mruby-array-ext/mrblib/array.rb @@ -209,7 +209,7 @@ class Array # a.flatten(1) #=> [1, 2, 3, [4, 5]] # def flatten(depth=nil) - res = dup + res = Array.new(self) res.flatten! depth res end |
