-
Notifications
You must be signed in to change notification settings - Fork 682
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
Fix cppcheck postfix operator issues #1251
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev #1251 +/- ##
==========================================
- Coverage 82.42% 82.41% -0.01%
==========================================
Files 161 161
Lines 20750 20737 -13
Branches 7832 7838 +6
==========================================
- Hits 17103 17091 -12
+ Misses 2979 2977 -2
- Partials 668 669 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Common++/src/TablePrinter.cpp
Outdated
} | ||
|
||
totalLen++; | ||
int totalLen = std::accumulate(m_ColumnWidths.begin(), m_ColumnWidths.end(), m_ColumnWidths.size() * 3) + 1; |
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.
more clearer!
@egecetin I would suggest not using |
…into fix-postfix
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.
Please see one small comment, otherwise approved!
Common++/src/TablePrinter.cpp
Outdated
} | ||
|
||
totalLen++; | ||
int totalLen = std::accumulate(m_ColumnWidths.begin(), m_ColumnWidths.end(), m_ColumnWidths.size() * 3) + 1; |
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.
nit: maybe use auto
for totalLen
and for the for
loop later?
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.
A not important note, I noticed there are still some postfix operators not generating warnings. For example you mentioned a for loop in #1251 (comment) which has |
Most of the postfix warnings comes from old iterator based for loops so replaced them with
auto
to help #977