use sdbusplus unpack syntax
Rather than defining a variable and then reading it from a message,
sdbusplus also supports directly unpack-ing from the message. Use
this syntax instead as it is more efficient and succinct.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I23902026dee367a8cbf0c2725725c4ed3ca4d2bb
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index 7c4c5ab..cb6942f 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -179,10 +179,10 @@
try
{
// This is signal callback
- std::string interfaceName;
- msg.read(interfaceName);
- ipmi::PropertyMap props;
- msg.read(props);
+ auto interfaceName = msg.unpack<std::string>();
+
+ auto props = msg.unpack<ipmi::PropertyMap>();
+
s.second.getFunc(s.first, s.second, props);
}
catch (const std::exception& e)