gitlab-org--gitlab-foss/lib/declarative_policy
Sean McGivern d771719278 Speed up DeclarativePolicy::Runner#steps_by_score
There were a couple of things here:

1. If the state was already enabled, we don't need to check all the remaining
   steps - only those that can prevent the state. (An enable followed by an
   enable is a no-op.) This logic is in `#run`, but we still did the work of
   scoring and sorting the steps.
2. The sorting is known to be inefficient, but we can make it slightly more
   efficient by stopping once we have a step with zero score, as that means it's
   free.

Neither of these make this _fast_, especially when called lots of times - as we
do when there is lots of activity on an issue - but they do help some.
2017-10-04 13:50:05 +01:00
..
base.rb Merge branch 'rs-more-public-send-whitelists' into 'master' 2017-08-16 11:25:26 +00:00
cache.rb
condition.rb cache the cache key... 2017-07-17 14:38:48 -07:00
dsl.rb Whitelist or fix additional `Gitlab/PublicSend` cop violations 2017-08-14 12:14:11 -04:00
preferred_scope.rb
rule.rb
runner.rb Speed up DeclarativePolicy::Runner#steps_by_score 2017-10-04 13:50:05 +01:00
step.rb