Clean up firstEntry boolean checks
The check if firstEntry is true is unnecessary and it is safe to always
set to false after the first entry ID is found. So, we can clean up a
few lines of if checks and always set to false.
Tested:
Confirmed that log entries are still listed correctly.
Change-Id: If3bb1a37696786e43860848c9a038b70424950e6
Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index 8b1466a..e484649 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -1211,11 +1211,7 @@
{
continue;
}
-
- if (firstEntry)
- {
- firstEntry = false;
- }
+ firstEntry = false;
logEntryArray.push_back({});
nlohmann::json& bmcLogEntry = logEntryArray.back();
@@ -1277,11 +1273,7 @@
{
continue;
}
-
- if (firstEntry)
- {
- firstEntry = false;
- }
+ firstEntry = false;
if (idStr == targetID)
{
@@ -2226,11 +2218,7 @@
{
continue;
}
-
- if (firstEntry)
- {
- firstEntry = false;
- }
+ firstEntry = false;
logEntryArray.push_back({});
nlohmann::json& bmcJournalLogEntry = logEntryArray.back();
@@ -2303,10 +2291,7 @@
messages::internalError(asyncResp->res);
return;
}
- if (firstEntry)
- {
- firstEntry = false;
- }
+ firstEntry = false;
}
// Confirm that the entry ID matches what was requested
if (idStr != entryID)