diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-07-25 14:42:38 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-07-25 14:42:38 +0900 |
| commit | 7b8d784040f1fd88fce2658b704b300f7421c885 (patch) | |
| tree | b0713b02d0c5f403749997c3874266748134c03f /mrbgems/mruby-enum-ext | |
| parent | 7f9e3336473f13d0e459cdedba665a6bf14f877f (diff) | |
| download | mruby-7b8d784040f1fd88fce2658b704b300f7421c885.tar.gz mruby-7b8d784040f1fd88fce2658b704b300f7421c885.zip | |
Reimplement sort method to reduce array copying.
Diffstat (limited to 'mrbgems/mruby-enum-ext')
| -rw-r--r-- | mrbgems/mruby-enum-ext/mrblib/enum.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-enum-ext/mrblib/enum.rb b/mrbgems/mruby-enum-ext/mrblib/enum.rb index 7e101cf65..7741e515d 100644 --- a/mrbgems/mruby-enum-ext/mrblib/enum.rb +++ b/mrbgems/mruby-enum-ext/mrblib/enum.rb @@ -201,7 +201,7 @@ module Enumerable ary.push([block.call(e), i]) } if ary.size > 1 - __sort_sub__(ary, ::Array.new(ary.size), 0, 0, ary.size - 1) do |a,b| + __sort_sub__(ary, 0, ary.size - 1) do |a,b| a <=> b end end |
