Replace boost starts_with with std::string
C++20 introduces std::string::starts_with, which provide standard,
efficient, and header-light ways to check string prefixes and
suffixes. Replacing boost::algorithm::starts_with reduces Boost
dependencies, simplifies includes, and improves compilation
performance.
Change-Id: If2647832e7dee4ff4e7a1e616ca1c288ff31b955
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
diff --git a/src/sel_logger.cpp b/src/sel_logger.cpp
index b1aa52a..4666dd7 100644
--- a/src/sel_logger.cpp
+++ b/src/sel_logger.cpp
@@ -15,7 +15,6 @@
*/
#include <systemd/sd-journal.h>
-#include <boost/algorithm/string.hpp>
#include <boost/asio/io_context.hpp>
#include <boost/container/flat_map.hpp>
#include <boost/container/flat_set.hpp>
@@ -70,7 +69,7 @@
std::filesystem::directory_iterator(selLogDir))
{
std::string filename = dirEnt.path().filename();
- if (boost::starts_with(filename, selLogFilename))
+ if (filename.starts_with(selLogFilename))
{
// If we find an ipmi_sel log file, save the path
selLogFiles.emplace_back(selLogDir / filename);