Make Set a builtin feature [Feature #16989]

This commit is contained in:
Akinori MUSHA 2022-02-17 18:02:42 +09:00
parent 7757ccb504
commit dd3501bb95
Notes: git 2022-02-18 11:56:45 +09:00
3 changed files with 49 additions and 1 deletions

View file

@ -854,7 +854,7 @@ module Enumerable
# Needs to `require "set"` to use this method.
def to_set(klass = Set, *args, &block)
klass.new(self, *args, &block)
end
end unless method_defined?(:to_set)
end
autoload :SortedSet, "#{__dir__}/set/sorted_set"