why break is required here? There’s only unique service_type in services so after the if condition for the matching service_type you should get exactly one matching res[‘service’] even after completing the loop.
why break is required here?
There's only unique service_type in services so after the if condition for the matching service_type you should get exactly one matching res['service'] even after completing the loop.
You are right, that the break is not necessary. The reason I use it here is to shorten the runtime a bit. The loop breaks because 1 result is expected, otherwise the loop would run further which is not necessary and results in larger runtime of this loop.
You are right, that the break is not necessary. The reason I use it here is to shorten the runtime a bit. The loop breaks because 1 result is expected, otherwise the loop would run further which is not necessary and results in larger runtime of this loop.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Build succeeded. https://zuul.otc-service.com/t/gl/buildset/40839dd46402477e9783b92fc3fe3bbe
@@ -212,0 +226,4 @@for service in services['services']:if service['service_type'] == service_type:res['service'] = servicebreakwhy break is required here? There’s only unique service_type in services so after the if condition for the matching service_type you should get exactly one matching res[‘service’] even after completing the loop.
You are right, that the break is not necessary. The reason I use it here is to shorten the runtime a bit. The loop breaks because 1 result is expected, otherwise the loop would run further which is not necessary and results in larger runtime of this loop.
Build succeeded. https://zuul.otc-service.com/t/gl/buildset/bfe27bd4fd7e4ce2bb866ac37b110d99
Build succeeded. https://zuul.otc-service.com/t/gl/buildset/4dac254a5b4747a6b878c80f47355f28