Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Early Return from loops in a rule #209

Closed
anakrish opened this issue Apr 22, 2024 · 0 comments · Fixed by #189
Closed

Early Return from loops in a rule #209

anakrish opened this issue Apr 22, 2024 · 0 comments · Fixed by #189
Labels
perf Performance of regorus

Comments

@anakrish
Copy link
Collaborator

If a rule is written to produce a constant value, then not all iterations of loops within it need to be executed. Execution can stop via early return once the first iteration that produces a value has been executed.

This brings forth the question : What if one of the subsequent iterations would have resulted in an error?
e.g:
x {
[1, "hello"][_] + 1
}

Such errors are not raised; consistent with OPA.

@anakrish anakrish added the perf Performance of regorus label Apr 22, 2024
@anakrish anakrish mentioned this issue Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf Performance of regorus
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant