Break out SendEventToSubs

Breaking out this small function allows for rolling large parts of this
class into an RAII class in the next patch.

Tested: In the next patch.

Change-Id: I66916dcfd716f994913ff6f283e231b8933bdc99
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index 4197cda..37d047e 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -558,6 +558,17 @@
         return true;
     }
 
+    static void
+        sendEventsToSubs(const std::vector<EventLogObjectsType>& eventRecords)
+    {
+        for (const auto& it :
+             EventServiceManager::getInstance().subscriptionsMap)
+        {
+            Subscription& entry = *it.second;
+            entry.filterAndSendEventLogs(eventRecords);
+        }
+    }
+
     static void sendTelemetryReportToSubs(
         const std::string& reportId, const telemetry::TimestampReadings& var)
     {
@@ -704,15 +715,7 @@
             BMCWEB_LOG_DEBUG("No log entries available to be transferred.");
             return;
         }
-
-        for (const auto& it : subscriptionsMap)
-        {
-            std::shared_ptr<Subscription> entry = it.second;
-            if (entry->userSub->eventFormatType == "Event")
-            {
-                entry->filterAndSendEventLogs(eventRecords);
-            }
-        }
+        EventServiceManager::sendEventsToSubs(eventRecords);
     }
 };