DeclarativePolicy: reduce iterations of the step set

Merged username-removed-28993 requested to merge perf.policy-runner-reduce-loops into master

What does this MR do?

Reduces iterations of the step set by:

  • Using a decrementing counter instead of checking .all? in every iteration
  • More eagerly short-circuiting when the state is prevented.

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?