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: I54b14bc229d055428ec3183c488976e659e44d09
diff --git a/src/utils/dbus_mapper.hpp b/src/utils/dbus_mapper.hpp
index 24adc7a..6e089c7 100644
--- a/src/utils/dbus_mapper.hpp
+++ b/src/utils/dbus_mapper.hpp
@@ -48,8 +48,7 @@
method_call.append("/xyz/openbmc_project/sensors/", 2, sensorInterfaces);
auto reply = bus->call(method_call);
- std::vector<SensorTree> tree;
- reply.read(tree);
+ auto tree = reply.unpack<std::vector<SensorTree>>();
return tree;
}