Remove some boost includes
The less we rely on boost, and more on std algorithms, the less people
have to look up, and the more likely that our code will deduplicate.
Replace all uses of boost::algorithms with std alternatives.
Tested: Redfish Service Validator passes.
Change-Id: I8a26f39b5709adc444b4178e92f5f3c7b988b05b
Signed-off-by: Ed Tanous <edtanous@google.com>
diff --git a/include/ibm/locks.hpp b/include/ibm/locks.hpp
index 7a161fc..3bb82b9 100644
--- a/include/ibm/locks.hpp
+++ b/include/ibm/locks.hpp
@@ -3,7 +3,6 @@
#include "ibm/utils.hpp"
#include "logging.hpp"
-#include <boost/algorithm/string/predicate.hpp>
#include <boost/container/flat_map.hpp>
#include <boost/endian/conversion.hpp>
#include <nlohmann/json.hpp>
@@ -363,8 +362,8 @@
{
// validate the locktype
- if (!((boost::equals(std::get<2>(refLockRecord), "Read") ||
- (boost::equals(std::get<2>(refLockRecord), "Write")))))
+ if (!((std::get<2>(refLockRecord) == "Read" ||
+ (std::get<2>(refLockRecord) == "Write"))))
{
BMCWEB_LOG_DEBUG("Validation of LockType Failed");
BMCWEB_LOG_DEBUG("Locktype : {}", std::get<2>(refLockRecord));
@@ -392,9 +391,8 @@
// validate the lock flags
// Allowed lockflags are locksame,lockall & dontlock
- if (!((boost::equals(p.first, "LockSame") ||
- (boost::equals(p.first, "LockAll")) ||
- (boost::equals(p.first, "DontLock")))))
+ if (!((p.first == "LockSame" || (p.first == "LockAll") ||
+ (p.first == "DontLock"))))
{
BMCWEB_LOG_DEBUG("Validation of lock flags failed");
BMCWEB_LOG_DEBUG("{}", p.first);
@@ -411,8 +409,7 @@
return false;
}
- if ((boost::equals(p.first, "LockSame") ||
- (boost::equals(p.first, "LockAll"))))
+ if ((p.first == "LockSame" || (p.first == "LockAll")))
{
++lockFlag;
if (lockFlag >= 2)
@@ -534,8 +531,8 @@
{
// No conflict if both are read locks
- if (boost::equals(std::get<2>(refLockRecord1), "Read") &&
- boost::equals(std::get<2>(refLockRecord2), "Read"))
+ if (std::get<2>(refLockRecord1) == "Read" &&
+ std::get<2>(refLockRecord2) == "Read")
{
BMCWEB_LOG_DEBUG("Both are read locks, no conflict");
return false;
@@ -546,8 +543,8 @@
{
// return conflict when any of them is try to lock all resources
// under the current resource level.
- if (boost::equals(p.first, "LockAll") ||
- boost::equals(std::get<4>(refLockRecord2)[i].first, "LockAll"))
+ if (p.first == "LockAll" ||
+ std::get<4>(refLockRecord2)[i].first == "LockAll")
{
BMCWEB_LOG_DEBUG(
"Either of the Comparing locks are trying to lock all "
@@ -558,8 +555,8 @@
// determine if there is a lock-all-with-same-segment-size.
// If the current segment sizes are the same,then we should fail.
- if ((boost::equals(p.first, "LockSame") ||
- boost::equals(std::get<4>(refLockRecord2)[i].first, "LockSame")) &&
+ if ((p.first == "LockSame" ||
+ std::get<4>(refLockRecord2)[i].first == "LockSame") &&
(p.second == std::get<4>(refLockRecord2)[i].second))
{
return true;