When looking at RuboCop
's code, I noticed a big number of frozen arrays being used only to later call include?
on them. This is O(n)
instead of O(1)
.
Trying to convert them to Set
s causes major compatibility issues, as well as very frustrating situations (See set.join
and array + set
) and where the fact that they are now Set
s makes them much less efficient (See array & set
).
Here are the improvements that would improve Set
s: