You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The result of `rspec_pattern` is always the same (because it is based
on the configuration file), so there is no need to re-calculate it every
time it is called.
I tried memozing on the Cop instance, but at least when running the
specs, we instantiate Cop way too often. Memoizing on the class level
reduces the number of calculations to once per `Cop` subclass we have.
If we allowed using class variables (`@@rspec_pattern`) we could reduce
the number of calculations to one.
This commit reverts 995b4fe and adds
memoization in a class instance variable.
0 commit comments