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

refactor: code inspection: 'size() == 0' replaceable with 'isEmpty()' #2232

Merged
merged 1 commit into from
Jul 17, 2018
Merged

refactor: code inspection: 'size() == 0' replaceable with 'isEmpty()' #2232

merged 1 commit into from
Jul 17, 2018

Conversation

zielint0
Copy link
Contributor

@zielint0 zielint0 commented Jul 16, 2018

Code style issues

  • 'size() == 0' replaceable with 'isEmpty()'

This is also SonarQube checker (Use isEmpty() to check whether the collection is empty or not.).

Rationale
To check number of elements, use isEmpty(). It is more readable and understandable than size().

@surli surli merged commit 97f6af6 into INRIA:master Jul 17, 2018
@zielint0 zielint0 deleted the refactor-code-inspection-code-style-issues-isempty branch July 17, 2018 19:11
@monperrus monperrus mentioned this pull request Sep 20, 2018
4 tasks
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