ruby / set

This library provides the Set class, which deals with a collection of unordered values with no duplicates.
BSD 2-Clause "Simplified" License
23 stars 13 forks source link

Remove `object_id` use in `Set#flatten` #34

Open amomchilov opened 8 months ago

amomchilov commented 8 months ago

Found this while auditing uses of object_id in ruby/ruby. Pulled out from ruby/ruby#9276.

This PR replaces look-ups into a Set by object_ids, with an identity Set (see Set#compare_by_identity). This has the same semantics but is faster and doesn't trigger allocation of IDs for these objects.