refine: remove dead branch and fix comment typos in intersect/except preprocess - #6079
Merged
Merged
Conversation
…preprocess
- Remove `if res.is_empty() { continue; }` in `intersect`: it sits directly
after `res.push(t)`, so `res` always has at least one element and the
branch is unreachable.
- Fix comment typos: `INTERCEPT`/`Intercept` -> `INTERSECT`/`Intersect`,
and drop stray `except` words in the INTERSECT/EXCEPT `ALL -> DISTINCT`
comments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small cleanup in
prqlc/prqlc/src/sql/pq/preprocess.rs, found during the nightly code-quality sweep.Dead code
In
intersect,if res.is_empty() { continue; }sits directly afterres.push(t), soresalways has at least one element and the branch is unreachable. Removed it. (The analogous guard inexceptis the meaningfulif res.len() < 2, which is left untouched.)Comment typos
INTERCEPT ALL is not supported→INTERSECT ALL is not supportedDon't create Intercept→Don't create IntersectINTERSECT ALL can become except INTERSECT DISTINCT→ drop the strayexceptEXCEPT ALL can become except EXCEPT DISTINCT→ drop the strayexceptNo behavior change — the removed branch was provably unreachable and the rest are comment-only.
cargo test -p prqlc --liband the fullintegrationsuite (471 tests, including thesql::set that exercises intersect/except) pass, so no new regression test is added.