-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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 a number of performance issues (reported by Coverity Scan) #3967
Conversation
Signed-off-by: Stefan Weil <[email protected]>
The fix is not very right. |
I did not know For two files I replaced |
In other words |
That's indeed a nice feature, but an explicit So how should we fix the reported performance issues? Use |
When you will be updating code
Almost always
While refreshing codebase all such cases must be changed to
Did not see So, we should use |
I updated the PR now to use |
Coverity Scan reports "Unnecessary object copies can affect performance" and suggests using the auto keyword with an &. Signed-off-by: Stefan Weil <[email protected]>
thanks |
The latest scan reported a number of performance issues because
several
for
loops used expensive copy operations.After adding the
const
attribute to compare operators,const
could also be used in most
for
loops.