diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-04-28 17:45:19 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-04-28 17:45:19 +0900 |
| commit | aff3743c129602d7757d2ffd690afcd42cc9cdc3 (patch) | |
| tree | cd0b652a960edd24bcb9c453d33ca98b5ce5dcc6 /mrbgems/mruby-array-ext | |
| parent | 9f77232b71597dbef3907ae4aaae1a5530889e56 (diff) | |
| download | mruby-aff3743c129602d7757d2ffd690afcd42cc9cdc3.tar.gz mruby-aff3743c129602d7757d2ffd690afcd42cc9cdc3.zip | |
array.rb: `Array#uniq` to return always `Array`.
Even called for subclass of `Array`, according to new Ruby3.0 behavior.
Other methods of `Array` behave as Ruby3.0 from the first hand.
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 becfcb3ca..ecd09aa6e 100644 --- a/mrbgems/mruby-array-ext/mrblib/array.rb +++ b/mrbgems/mruby-array-ext/mrblib/array.rb @@ -51,7 +51,7 @@ class Array # b.uniq { |s| s.first } # => [["student", "sam"], ["teacher", "matz"]] # def uniq(&block) - ary = self.dup + ary = self[0..-1] ary.uniq!(&block) ary end |
