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 SortedSet implementations #2

Closed knu closed 3 years ago

knu commented 3 years ago

It required RBTree to perform decently and the external dependency was not suitable for a standard library. The pure ruby fallback implementation was originally meant to be a demonstration of how to write a subclass of Set, and its poor performance was not suitable for use in production.

I decided it should be distributed as an external library instead of bundling it with Set.

ioquatix commented 3 years ago

I completely agree, and it's performance is not great.

marcandre commented 3 years ago

I don't know if these are used much or at all (I notice that there's a typo in the class RestricedSet!), but nevertheless, maybe it would be a good idea to keep compatibility for one full version of Ruby? We could use autoload on both SortedSet and RestricedSet to load a different file that could issue a warning, and remove that for Ruby 3.1. The external library should be available now too (containing the same code) and this would make for a nice transition period for anyone using SortedSet

knu commented 3 years ago

Just pushed sorted_set 1.0.0: https://rubygems.org/gems/sorted_set