MantisBT - Doomseeker | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0003817 | Doomseeker | [All Projects] Cleanup | public | 2020-06-07 06:41 | 2020-06-07 20:55 |
Reporter | WubTheCaptain | ||||
Assigned To | |||||
Priority | none | Severity | tweak | Reproducibility | sometimes |
Status | confirmed | Resolution | open | ||
Platform | OS | OS Version | |||
Product Version | 1.3.1 | ||||
Target Version | Fixed in Version | ||||
Summary | 0003817: std::string compare method is sometimes used instead of equality/inequality operators | ||||
Description | I think some of these string comparisons with std::string's compare method don't make sense over equality or inequality operators (== or !=). Bad readability, clang-tidy seems to agree. | ||||
Steps To Reproduce | An example:Quote from src/core/irc/ircuserinfo.cppbool IRCUserInfo::operator==(const IRCUserInfo &otherUser) const { QString thisNickname = this->cleanNicknameLowerCase(); QString otherNickname = otherUser.cleanNicknameLowerCase(); return thisNickname.compare(otherNickname) == 0; } Could instead have written return thisNickname == otherNickname. grep -r '\.compare' src/ | less to sort through some of these. Some Qt::CaseInsensitive cases make sense. | ||||
Additional Information | 'https://clang.llvm.org/extra/clang-tidy/checks/readability-string-compare.html [^]' | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2020-06-07 06:41 | WubTheCaptain | New Issue | |||
2020-06-07 06:46 | WubTheCaptain | Note Added: 0021367 | |||
2020-06-07 20:55 | Pol M | Note Added: 0021391 | |||
2020-06-07 20:55 | Pol M | Status | new => confirmed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|