KCTimeFactory: port away from QSet::toList()
AbandonedPublic

Authored by dfaure on Dec 8 2019, 10:57 PM.

Details

Reviewers
vkrause
aacid
Summary

It's deprecated in favor of values(), but both make this code
rather expensive, creating a temporary QSet for nothing.
For just a few items, linear search is faster than creating a hash
table.

Test Plan

Builds; tests pass

Diff Detail

Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 19604
Build 19622: arc lint + arc unit
dfaure requested review of this revision.Dec 8 2019, 10:57 PM
dfaure created this revision.
aacid added a comment.Dec 9 2019, 12:01 AM

Am i reading the code wrong or this is never used?

remainingResourceList only gets called from
./src/sycoca/kbuildsycoca.cpp:310
and that adds the strings to m_changedResources which is never used?

m_changedResources is only ever appended to or returned from
./src/sycoca/kbuildsycoca_p.h:60: QStringList changedResources() const

but that function is never called?

dfaure abandoned this revision.Dec 9 2019, 8:42 AM

Well spotted! Now that's quality code review :-)

Indeed, some past changes made this dead code. I removed it all.
https://commits.kde.org/kservice/967cbe4973aaa765dca1156067bf6b5ca1687486