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

Replace some folds with exists or for_all #1614

Merged
merged 2 commits into from
Nov 1, 2024
Merged

Replace some folds with exists or for_all #1614

merged 2 commits into from
Nov 1, 2024

Conversation

sim642
Copy link
Member

@sim642 sim642 commented Nov 1, 2024

After seeing them in BasePriv, I added the semgrep rules to do a systematic search.
All of the findings are either replaced or suppressed because the condition also performs side effects.

Using exists and for_all is better (when possible) because they stop iterating early while fold is forced to go through the entire data structure.

@sim642 sim642 added cleanup Refactoring, clean-up performance Analysis time, memory usage labels Nov 1, 2024
src/incremental/compareCFG.ml Dismissed Show dismissed Hide dismissed
@sim642 sim642 added this to the v2.5.0 milestone Nov 1, 2024
@sim642 sim642 merged commit 750f1ee into master Nov 1, 2024
21 checks passed
@sim642 sim642 deleted the semgrep-fold branch November 1, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Refactoring, clean-up performance Analysis time, memory usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants