Bug 192707 - clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
Summary: clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-12-14 10:49 PST by David Kilzer (:ddkilzer)
Modified: 2018-12-17 20:10 PST (History)
5 users (show)

See Also:


Attachments
Patch v1 (3.61 KB, patch)
2018-12-14 10:56 PST, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2018-12-14 10:49:55 PST
Running `clang-tidy -checks='-*,performance-*,-performance-noexcept-*' ...` on WebCore source files found this unnecessary object copy:

Source/WebCore/platform/CPUMonitor.cpp:38:52: warning: the parameter 'cpuLimit' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
void CPUMonitor::setCPULimit(std::optional<double> cpuLimit)
                                                   ^
                             const                &
Comment 1 Radar WebKit Bug Importer 2018-12-14 10:50:43 PST
<rdar://problem/46734926>
Comment 2 David Kilzer (:ddkilzer) 2018-12-14 10:56:24 PST
Created attachment 357323 [details]
Patch v1
Comment 3 WebKit Commit Bot 2018-12-17 20:09:59 PST
Comment on attachment 357323 [details]
Patch v1

Clearing flags on attachment: 357323

Committed r239315: <https://trac.webkit.org/changeset/239315>
Comment 4 WebKit Commit Bot 2018-12-17 20:10:00 PST
All reviewed patches have been landed.  Closing bug.