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

Use isEmpty() instead of length() #3138

Merged
merged 1 commit into from
Apr 14, 2024
Merged

Conversation

dukbong
Copy link
Contributor

@dukbong dukbong commented Apr 14, 2024

This pull request suggests using isEmpty() instead of length().

Rationale:

  • Readability: The isEmpty() method clearly conveys the intention of checking if the collection is empty. Therefore, it makes it easier for developers to understand the code.
  • Intended Behavior: The isEmpty() method is designed to check if a collection is empty. This aligns better with the developer's intention and makes the code more expressive.
  • Common Convention: In the Java collection framework, it's common to use the isEmpty() method to check if a collection is empty. Following this common convention helps maintain consistency in the codebase.

In conclusion, using the isEmpty() method improves code readability and aligns better with the intended behavior. It also adheres to the common convention in the Java collection framework.

@hazendaz hazendaz self-assigned this Apr 14, 2024
@coveralls
Copy link

Coverage Status

coverage: 87.167%. remained the same
when pulling a020b39 on dukbong:Refactoring
into 382cbf4 on mybatis:master.

@hazendaz hazendaz merged commit e9e9a29 into mybatis:master Apr 14, 2024
19 checks passed
@dukbong dukbong deleted the Refactoring branch April 16, 2024 04:09
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.

None yet

3 participants