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

[java] Cleanup isAllowed method as it can be much more simple #483

Merged
merged 2 commits into from
Feb 14, 2023

Conversation

hazendaz
Copy link
Collaborator

No description provided.

@hazendaz hazendaz self-assigned this Feb 13, 2023
} else {
return false;
}
return (matched && allowed) || (!matched && !allowed);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return !(matched ^ allowed)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think that does not apply given how the checks are but Eclipse is suggesting far, far easier -> 'returned matched == allowed'.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updating PR with suggestion from eclipse better look at.

Copy link
Owner

@mathieucarbou mathieucarbou Feb 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol indeed ;-) false == false is true ;-)

@mathieucarbou mathieucarbou merged commit d162eb3 into mathieucarbou:master Feb 14, 2023
@mathieucarbou mathieucarbou added this to the 4.2 milestone Mar 23, 2023
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.

2 participants