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: I8fad3008ef41aba7d4a00b12f41c7a8c6d5908ab
diff --git a/bmc/activation.cpp b/bmc/activation.cpp
index 67c2881..6f8caca 100644
--- a/bmc/activation.cpp
+++ b/bmc/activation.cpp
@@ -382,8 +382,8 @@
{
auto reply = bus.call(method);
- std::variant<std::string> result;
- reply.read(result);
+ auto result = reply.unpack<std::variant<std::string>>();
+
auto applyTime = std::get<std::string>(result);
if (applyTime == applyTimeImmediate)
{
diff --git a/bmc/item_updater.cpp b/bmc/item_updater.cpp
index 41ae150..8ee940e 100644
--- a/bmc/item_updater.cpp
+++ b/bmc/item_updater.cpp
@@ -748,8 +748,7 @@
auto response = bus.call(mapperCall);
using ObjectPaths = std::vector<std::string>;
- ObjectPaths result;
- response.read(result);
+ auto result = response.unpack<ObjectPaths>();
if (!result.empty())
{