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: I311c0a4a3aa8b68ea2814c00eaff11e2e8803fb1
diff --git a/dump/dump_utils.cpp b/dump/dump_utils.cpp
index 74ec563..fa776a6 100644
--- a/dump/dump_utils.cpp
+++ b/dump/dump_utils.cpp
@@ -87,8 +87,7 @@
uint64_t(failingUnit)}};
method.append(createParams);
- sdbusplus::message::object_path reply;
- bus.call(method).read(reply);
+ auto reply = bus.call(method).unpack<sdbusplus::message::object_path>();
monitorDumpCreation(reply.str, SBE_DUMP_TIMEOUT);
}
@@ -131,8 +130,9 @@
mapper.append(path, std::vector<std::string>({intf}));
auto mapperResponseMsg = bus.call(mapper);
- std::map<std::string, std::vector<std::string>> mapperResponse;
- mapperResponseMsg.read(mapperResponse);
+ auto mapperResponse =
+ mapperResponseMsg
+ .unpack<std::map<std::string, std::vector<std::string>>>();
if (mapperResponse.empty())
{