Calling #any?
on Set
is much slower than calling #empty?
and negating it! Take a look at these benchmarks.
Warming up --------------------------------------
#any? 182.420k i/100ms
not #empty? 2.432M i/100ms
Calculating -------------------------------------
#any? 1.834M (± 1.3%) i/s - 9.303M in 5.073017s
not #empty? 24.254M (± 0.3%) i/s - 121.597M in 5.013433s