Bug 192707

Summary: clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: WebCore Misc.Assignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, cdumez, commit-queue, dbates, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch v1 none

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.