Do not insert twice for first filter
On the first call, the filter list is empty,
the element will be insert two times, just return after the first insert.
Tested:
Check the filter callback functions, there is no duplicated call;
Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
Change-Id: I4e4d5147b5c0466b651700f79afcb34940e6f48a
diff --git a/ipmid-new.cpp b/ipmid-new.cpp
index 5ef6f4b..6740c65 100644
--- a/ipmid-new.cpp
+++ b/ipmid-new.cpp
@@ -199,6 +199,7 @@
if (filterList.empty() || std::get<int>(filterList.front()) < prio)
{
filterList.emplace_front(std::make_tuple(prio, filter));
+ return;
}
// walk the list and put it in the right place
auto j = filterList.begin();