Closed knu closed 3 years ago
I completely agree, and it's performance is not great.
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
Just pushed sorted_set 1.0.0: https://rubygems.org/gems/sorted_set
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.