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

Rewrite Boolean functions which use ternary operator for return value #143

Open
moseshll opened this issue Apr 1, 2024 · 0 comments
Open

Comments

@moseshll
Copy link
Collaborator

moseshll commented Apr 1, 2024

An old trope of the general form return (x == y)? 1 : 0;. Can be replaced with return x == y; but callers should be inspected in case they refer to 0 or '0' as the false value (it's possible, however unlikely).
Find them with: ack '\?\s+((1\s*:\s*0)|(0\s*:\s*1))' cgi lib bin

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

No branches or pull requests

1 participant