-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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: use NonEmpty() instead of !IsEmpty() #14499
Conversation
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Small nitpick: The code calls this |
Hehe... Good point. Which one do you prefer? I think |
doit |
Signed-off-by: Andres Taylor <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description
This is not super important, but it does take it's toll. Whenever reading an
if
statement that is using an identifier, and we are checking that it's not empty, we write something like this:The distance between the
!
and theIsEmpty()
is quite a few characters apart, and that forces me to do an extra mental step when reading code. I much prefer usingNotEmpty
for this:This makes the code slightly more readable, and we can use all the readability we can get.