clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Dec 2018 04:09:50 +0000 (04:09 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Dec 2018 04:09:50 +0000 (04:09 +0000)
commit5779405dc9911a740a994d54604c3d09ae809e8f
treece86c2d3c7bbfcc1ca48507203f553981075d17a
parent0eb43d49e78be07658633e549948c2dd954476d2
clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
<https://webkit.org/b/192707>
<rdar://problem/46734926>

Reviewed by Daniel Bates.

Source/WebCore:

* platform/CPUMonitor.cpp:
(WebCore::CPUMonitor::setCPULimit):
* platform/CPUMonitor.h:
(WebCore::CPUMonitor::setCPULimit):
- Change parameter to const reference to fix unnecessary copies.

Source/WebKit:

* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::updateCPUMonitorState):
- Pass m_cpuLimit directly since getting its value causes an
  identical std::optional<double> to be created unnecessarily.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/CPUMonitor.cpp
Source/WebCore/platform/CPUMonitor.h
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm