Simplify sensor path lookups
This commit drops 8k from the binary size.
Tested: SensorCollection returns sensor values as expected, same as
previously
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ife1dc40ff6745585ac6bc3f99cd5e6c4811baa56
diff --git a/redfish-core/lib/power.hpp b/redfish-core/lib/power.hpp
index 8eacb9b..118f397 100644
--- a/redfish-core/lib/power.hpp
+++ b/redfish-core/lib/power.hpp
@@ -131,8 +131,7 @@
asyncResp->res.jsonValue["PowerControl"] = nlohmann::json::array();
auto sensorAsyncResp = std::make_shared<SensorsAsyncResp>(
- asyncResp, chassisName,
- sensors::dbus::paths.at(sensors::node::power),
+ asyncResp, chassisName, sensors::dbus::powerPaths,
sensors::node::power);
getChassisData(sensorAsyncResp);
@@ -322,8 +321,7 @@
return;
}
auto sensorAsyncResp = std::make_shared<SensorsAsyncResp>(
- asyncResp, chassisName,
- sensors::dbus::paths.at(sensors::node::power),
+ asyncResp, chassisName, sensors::dbus::powerPaths,
sensors::node::power);
std::optional<std::vector<nlohmann::json>> voltageCollections;