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: Ic6d6e6d757396c42bc54f34aaeddb56a99c9391a
diff --git a/src/utils.cpp b/src/utils.cpp
index 369fb2d..f5e5cb3 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -132,9 +132,8 @@
auto mapperResponseMsg = bus.call(mapper);
- std::vector<std::pair<std::string, std::vector<std::string>>>
- mapperResponse;
- mapperResponseMsg.read(mapperResponse);
+ auto mapperResponse = mapperResponseMsg.unpack<
+ std::vector<std::pair<std::string, std::vector<std::string>>>>();
services.reserve(mapperResponse.size());
for (const auto& i : mapperResponse)
{