Actions
Bug #15807
closedRange#minmax is slow and never returns for endless ranges
Bug #15807:
Range#minmax is slow and never returns for endless ranges
Description
current situation:
-
(1..).minmaxruns forever -
(1..).maxraises "cannot get the maximum of endless range" -
(1..Float::INFINITY).minmaxruns forever -
(1..Float::INFINITY).maxreturns instantly -
(1..1_000_000_000).minmaxtakes one minute -
(1..1_000_000_000).maxreturns instantly
my suggestion:
- implement
minmaxin range.c, return [range_min,range_max] - for endless ranges, this will trigger the same error as
maxdoes - delegate to enum (rb_call_super) only if called with a block (?)
i could perhaps provide a PR if you can point me to some information on how to contribute.
cheers!
Files
Actions