Performance: Ignore request if the group is already in requested state
The existing code did not check if the requested state is same as the
current state of group. However, it did not do any harm. Just some wasted
processing. This patch ignores such requests.
Change-Id: If4f02cb6d285fceedf1dc7ff45db3153d2ef3e72
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
diff --git a/group.cpp b/group.cpp
index fc2cef6..9292770 100644
--- a/group.cpp
+++ b/group.cpp
@@ -11,6 +11,13 @@
/** @brief Overloaded Property Setter function */
bool Group::asserted(bool value)
{
+ // If the value is already what is before, return right away
+ if (value ==
+ sdbusplus::xyz::openbmc_project::Led::server::Group::asserted())
+ {
+ return value;
+ }
+
// Introducing these to enable gtest.
Manager::group ledsAssert{};
Manager::group ledsDeAssert{};