Details
-
Type:
Epic
-
Status: Open
-
Priority:
P3: Somewhat important
-
Resolution: Unresolved
-
Affects Version/s: 6.3.0
-
Fix Version/s: None
-
Component/s: Core: Animation Framework, Core: Containers and Algorithms, Core: Date/Time, Core: Event loop, Core: Filesystem watching, Core: I/O, Core: Item Models, Core: Locales (i18n), Core: Object Model, Core: Other, Core: Plugins, Core: QString and Unicode, Core: QtConcurrent, Core: Resource System, Core: State Machine, Core: Threads, Core: URL Handling, Network
-
Labels:None
-
Epic Name:Expensive default arguments
-
Platform/s:
Description
Default arguments are a convenient way to avoid overloads, but if the defaulted argument isn't a Trivial Type, and a common use case is to not pass the extra argument explicitly, the construction of the temporary can dominate the call's runtime. It certainly causes useless code being emitted at the call site.
Therefore, check all of our APIs for non-trivial default arguments and consider replacing them with overloads.
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-98117 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
380545,5 | QHash: optimize value(key) and key(value) callers | dev | qt/qtbase | Status: MERGED | +2 | 0 |
396713,2 | QSettings: overload value() instead of using a default argument | dev | qt/qtbase | Status: MERGED | +2 | 0 |
396918,2 | QSettings: overload value() instead of using a default argument | 6.3 | qt/qtbase | Status: MERGED | +2 | 0 |