-
Notifications
You must be signed in to change notification settings - Fork 125
refactor: use container.empty() instead of container.size() == 0 #1957
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
base: main
Are you sure you want to change the base?
refactor: use container.empty() instead of container.size() == 0 #1957
Conversation
…dability-container-size-empty)
d87241f to
9174538
Compare
xezon
left a comment
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.
Nice improvement. With std::list from STLPort this can give small performance gains too.
| m_playerColors[i] = 0; | ||
| } | ||
| if (incomingRequest.password.length() > 0) | ||
| if (!incomingRequest.password.empty()) |
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.
I suspect clang-tidy only finds std:: related cases, unless it can be configured for other types?
We still need the same kind of change for AsciiString and other internal types (in another change).
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.
I got this plugin working for AsciiString and UnicodeString clang-tidy-plugin
Are there others?
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.
There are string classes in WWVegas too.
Search for wwstring.h (there are multiple)
|
Is this change complete or is it still missing checks from files it previously failed on? |
Ran clang-tidy (readability-container-size-empty))