mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
2699974c55
We had a number of helper methods that would start a timer, defer stopping it, and then do something to setup a Rego object for doing its thing. Many of these would have a check and then skip the step, but the timer would get a little bit of time accounted for it anyway for the `if` check and handling the deferred stop function. This refactors as many of these as I could find to do the if check and shortcut out before starting the timer. This will prevent any of the "no-op" steps from showing up in metrics. Signed-off-by: Patrick East <east.patrick@gmail.com>