Found by clazy.
Details
- Reviewers
broulik - Group Reviewers
Plasma - Commits
- R110:66a0c467dd51: Avoid creation of needless temporary containers
Diff Detail
- Repository
- R110 KScreen Library
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 3491 Build 3509: arc lint + arc unit
Nice findings, feel free to ignore the stylistic changes I commented, except the qDeleteAll one, and do unrelated further cleanup in a separate patch
backends/kwayland/waylandoutput.cpp | ||
---|---|---|
64 | I think we typically use const...() instead of c...() but since this method is const, shouldn't be neccessary to begin with | |
backends/qscreen/qscreenconfig.cpp | ||
46–47 | qDeleteAll(m_outputMap); | |
60 | This seems unused | |
src/output.cpp | ||
101 | count() | |
tests/kwayland/waylandconfigreader.cpp | ||
116–118 | We do a double lookup here, contains() and then operator[] afterwards, should be combined to a single find() |
backends/kwayland/waylandoutput.cpp | ||
---|---|---|
64 | Isn't it better to follow STL style? cbegin is also popular in KDE projects: https://lxr.kde.org/search?_filestring=&_string=cbegin |
src/output.cpp | ||
---|---|---|
101 | The previous code also compared the contents of both, or does your new loop below do that? |
src/output.cpp | ||
---|---|---|
101 | Yes, the check is in the loop below: after and before are of the same sizes, and if after contains each key from before, then their keys are equal. So return false if a key can't be found in after. |