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: Iebf93534fb4b68ec5f37f0b81fbe3456831d5d70
diff --git a/include/user_monitor.hpp b/include/user_monitor.hpp
index 70c4a1e..f1a5ad1 100644
--- a/include/user_monitor.hpp
+++ b/include/user_monitor.hpp
@@ -15,8 +15,8 @@
inline void onUserRemoved(sdbusplus::message_t& msg)
{
- sdbusplus::message::object_path p;
- msg.read(p);
+ auto p = msg.unpack<sdbusplus::message::object_path>();
+
std::string username = p.filename();
persistent_data::SessionStore::getInstance().removeSessionsByUsername(
username);