Remove SubscriptionId get and set functions
There are places to get or set subscription id differently like
`userSub.id` directly, or via `get/setSubscriptionId()` functions.
However, those aux functions are used only once and can be replaced to
access `userSub.id` directly.
Tested:
- Complies good
- Subscription GET and PATCH work correctly
Change-Id: I5cf81ba3ec0cb754387b40614e6309dca9a5305e
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index 66e92d5..5a64472 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -474,17 +474,6 @@
return eventSeqNum;
}
- void setSubscriptionId(const std::string& idIn)
- {
- BMCWEB_LOG_DEBUG("Subscription ID: {}", idIn);
- userSub.id = idIn;
- }
-
- std::string getSubscriptionId() const
- {
- return userSub.id;
- }
-
bool matchSseId(const crow::sse_socket::Connection& thisConn)
{
return &thisConn == sseConn;
@@ -847,7 +836,7 @@
}
// Set Subscription ID for back trace
- subValue->setSubscriptionId(id);
+ subValue->userSub.id = id;
persistent_data::UserSubscription newSub(subValue->userSub);
@@ -958,8 +947,7 @@
if (entryIsThisConn)
{
persistent_data::EventServiceStore::getInstance()
- .subscriptionsConfigMap.erase(
- it->second->getSubscriptionId());
+ .subscriptionsConfigMap.erase(entry->userSub.id);
it = subscriptionsMap.erase(it);
return;
}