From 0a1f686cb44a19a4c459cfe2cbb3cc565749066d Mon Sep 17 00:00:00 2001 From: Matthew Barth Date: Wed, 30 Jan 2019 16:27:38 -0600 Subject: Use zone object's path attribute A zone's object path is set when the zone is created and available to be used instead of determining the zone's object path each time. Change-Id: Iddfebd1545bb49054d95f8c19a71b2fbf9c2f592 Signed-off-by: Matthew Barth --- control/zone.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'control') diff --git a/control/zone.cpp b/control/zone.cpp index 7a5f926..326ca68 100644 --- a/control/zone.cpp +++ b/control/zone.cpp @@ -329,14 +329,11 @@ void Zone::initEvent(const SetSpeedEvent& event) // When match is empty, handle if zone object member if (std::get(sig).empty()) { - fs::path path{CONTROL_OBJPATH}; - path /= std::to_string(_zoneNum); - // Set event data for each host group member for (auto it = std::get(event).begin(); it != std::get(event).end(); ++it) { - if (it->first == path.string()) + if (it->first == _path) { // Group member interface in list owned by zone if (std::find(_ifaces.begin(), _ifaces.end(), @@ -643,9 +640,7 @@ std::string Zone::current(std::string value) current = ThermalObject::current(value); saveCurrentMode(); // Trigger event(s) for custom mode property change - fs::path path{CONTROL_OBJPATH}; - path /= std::to_string(_zoneNum); - auto eData = _objects[path.string()] + auto eData = _objects[_path] ["xyz.openbmc_project.Control.ThermalMode"] ["Current"]; if (eData != nullptr) -- cgit v1.2.1