Deduplicate ExpectedSignal creation code by moving it where it
belongs, into proper constructors.
Details
- Reviewers
dvratil - Group Reviewers
KDE PIM - Commits
- R165:1e665877b228: Move construction of ExpectedSignal where it belongs
Diff Detail
- Repository
- R165 Akonadi
- Branch
- move-expected-signal-construction
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 4436 Build 4454: arc lint + arc unit
autotests/libs/entitytreemodeltest.cpp | ||
---|---|---|
158 | You may even be able to get rid of the type name, as that can be deduced from the initializer list type, or not? | |
554–557 | const | |
autotests/libs/modelspy.h | ||
46 | The move here is kinda pointless: Qt classes are implicitly shared, so copying them means only copying a pointer. And if you make the arguments const &, calling the ctor would be a no-copy and initialization of the member variable would be a copy. Your approach requires a copy to call the ctor and then move for initialization - so copy vs copy+move: const & wins here :) And while this may sound contradictory to what I replied to your email regarding performance compromises when refactoring, the std::move does not IMO improve code readability or quality (compared to just passing non-POD args as const & ) in this case. | |
autotests/libs/tagmodeltest.cpp | ||
174 | const | |
219–221 | const | |
267 | const | |
327 | const |
Added seven consts
Got rid of explicit type names for the construction of the elements of a QList<ExpectedSignal>
autotests/libs/modelspy.h | ||
---|---|---|
46 | Fully agreed. |