Skip to content

review: cmp.Or for zero-value fallbacks - #12

Merged
CMGS merged 1 commit into
masterfrom
review/cmpor-fallbacks
Sep 7, 2026
Merged

CMGS merged 1 commit into
masterfrom
review/cmpor-fallbacks

Conversation

@CMGS

@CMGS CMGS commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Why

First gate run of the new asl analyzers: cmpor rewrites if x != zero { return x }; return y and if x == zero { x = y } into cmp.Or(x, y) where the fallback is call-free (cmp.Or evaluates every argument).

What

1 cmp.Or rewrites, applied by asl -fix and goimports; no behaviour change.

Evidence

make fmt-check clean; make lint 0 issues on linux and darwin; asl clean on both GOOS; go test -race -count=1 ./... with no FAIL lines (log kept locally).

The asl cmpor analyzer rewrites the if/return and if/assign zero-value
fallbacks into cmp.Or where the fallback is call-free.
@CMGS
CMGS merged commit bdf17ee into master Sep 7, 2026
2 checks passed
@CMGS
CMGS deleted the review/cmpor-fallbacks branch September 7, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant