Skip to content

Commit d5bf3c1

Browse files
committed
Fix Array#to_h
1 parent f319619 commit d5bf3c1

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Bug fixes:
44

55
* Sharing for thread-safety of objects is now triggered later as intended, e.g., when a second `Thread` is started.
6+
* Fixed `Array#to_h` so it doesn't set a default value (#1698).
67

78
Compatibility:
89

spec/tags/core/array/to_h_tags.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/main/ruby/truffleruby/core/array.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ def to_ary
11821182
end
11831183

11841184
def to_h
1185-
h = Hash.new(size)
1185+
h = Hash.new
11861186
each_with_index do |elem, i|
11871187
elem = yield(elem) if block_given?
11881188
unless elem.respond_to?(:to_ary)

0 commit comments

Comments
 (0)