summaryrefslogtreecommitdiff
path: root/test/ruby/test_refinement.rb
diff options
context:
space:
mode:
authorJeremy Evans <[email protected]>2021-09-30 13:18:14 -0900
committer<[email protected]>2021-09-30 15:18:14 -0700
commit1f5f8a187adb746b01cc95c3f29a0a355f513374 ()
tree9d907b527d60b89f4c9d6402b1bdabb8aec7abf0 /test/ruby/test_refinement.rb
parenta55a5fc68426ed701dace6bc166d18de06d8dcb2 (diff)
Make Array#min/max optimization respect refined methods
Pass in ec to vm_opt_newarray_{max,min}. Avoids having to call GET_EC inside the functions, for better performance. While here, add a test for Array#min/max being redefined to test_optimization.rb. Fixes [Bug #18180]
Notes: Merged: https://.com/ruby/ruby/pull/4911 Merged-By: jeremyevans <[email protected]>
-rw-r--r--test/ruby/test_refinement.rb19
1 files changed, 19 insertions, 0 deletions
@@ -2537,6 +2537,25 @@ class TestRefinement < Test::Unit::TestCase
assert_equal(:second, klass.new.foo)
end
class Bug17822
module Ext
refine(Bug17822) do