summaryrefslogtreecommitdiffstats
path: root/pid
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-10-30 19:14:07 -0700
committerPatrick Venture <venture@google.com>2018-10-30 19:21:39 -0700
commit2d8e78510d8c1da8ea14cbccd3217275619eadd0 (patch)
tree948b82aba1c8ab9932f0df0ef880cb927e5cd598 /pid
parent1248b153393715ae8658215261b1e2a9478896eb (diff)
downloadphosphor-pid-control-2d8e78510d8c1da8ea14cbccd3217275619eadd0.tar.gz
phosphor-pid-control-2d8e78510d8c1da8ea14cbccd3217275619eadd0.zip
performance: fixup missing const reference in zone
Zone::getSensor is passed directly to the Sensor Manager getSensor which takes the parameter by reference. Make it use an explicit const reference at both layers. Change-Id: I4895ea2935d20b73b88d33972e44b9ac557cd988 Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'pid')
-rw-r--r--pid/zone.cpp2
-rw-r--r--pid/zone.hpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/pid/zone.cpp b/pid/zone.cpp
index 0c9718a..b1da7ec 100644
--- a/pid/zone.cpp
+++ b/pid/zone.cpp
@@ -324,7 +324,7 @@ void PIDZone::processThermals(void)
}
}
-Sensor* PIDZone::getSensor(std::string name)
+Sensor* PIDZone::getSensor(const std::string& name)
{
return _mgr.getSensor(name);
}
diff --git a/pid/zone.hpp b/pid/zone.hpp
index 3e2166c..6db7b7e 100644
--- a/pid/zone.hpp
+++ b/pid/zone.hpp
@@ -31,7 +31,7 @@ class ZoneInterface
virtual float getMaxRPMRequest() const = 0;
virtual bool getFailSafeMode() const = 0;
virtual float getFailSafePercent() const = 0;
- virtual Sensor* getSensor(std::string name) = 0;
+ virtual Sensor* getSensor(const std::string& name) = 0;
};
/*
@@ -68,7 +68,7 @@ class PIDZone : public ZoneInterface, public ModeObject
float getFailSafePercent(void) const override;
float getMinThermalRpmSetPt(void) const;
- Sensor* getSensor(std::string name) override;
+ Sensor* getSensor(const std::string& name) override;
void determineMaxRPMRequest(void);
void updateFanTelemetry(void);
void updateSensors(void);
OpenPOWER on IntegriCloud