Skip to content

Commit

Permalink
Implement short-circuit evaluation for group.include.all.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed Aug 20, 2024
1 parent cf2ae5f commit d9d7abe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/src/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* `clean` now cleans all caches by default.
* Submit jobs with `--constraint="scratch"` by default on Delta.
* Submit jobs with `--constraint="nvme"` by default on Frontier.
* `group.include.all` now employs short circuit evaluation.

*Fixed:*

Expand Down
5 changes: 3 additions & 2 deletions src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl Project {
Error::JSONPointerNotFound(name.clone(), include.clone())
})?;

if expr::evaluate_json_comparison(comparison, actual, expected)
if !expr::evaluate_json_comparison(comparison, actual, expected)
.ok_or_else(|| {
Error::CannotCompareInclude(
actual.clone(),
Expand All @@ -220,8 +220,9 @@ impl Project {
)
})?
{
matches += 1;
break;
}
matches += 1;
}
Ok(matches == conditions.len())
}
Expand Down

0 comments on commit d9d7abe

Please sign in to comment.