Use std::string_view::starts_with instead of boost::starts_with (#6918)

This commit is contained in:
Siarhei Fedartsou 2024-05-30 21:55:25 +02:00 committed by GitHub
parent fb9d1cefcc
commit c8de759cd6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View File

@ -23,6 +23,7 @@
- NodeJS:
- CHANGED: Use node-api instead of NAN. [#6452](https://github.com/Project-OSRM/osrm-backend/pull/6452)
- Misc:
- CHANGED: Use std::string_view::starts_with instead of boost::starts_with. [#6918](https://github.com/Project-OSRM/osrm-backend/pull/6918)
- CHANGED: Get rid of boost::math::constants::* and M_PI in favor of std::numbers. [#6916](https://github.com/Project-OSRM/osrm-backend/pull/6916)
- CHANGED: Make constants in PackedVector constexpr. [#6917](https://github.com/Project-OSRM/osrm-backend/pull/6917)
- CHANGED: Use std::variant instead of mapbox::util::variant. [#6903](https://github.com/Project-OSRM/osrm-backend/pull/6903)

View File

@ -8,8 +8,6 @@
#include "util/typedefs.hpp"
#include <boost/algorithm/string.hpp>
#include <algorithm>
#include <string>
#include <tuple>
@ -126,8 +124,7 @@ inline bool requiresNameAnnounced(const StringView &from_name,
// check similarity of names
const auto names_are_empty = from_name.empty() && to_name.empty();
const auto name_is_contained =
boost::starts_with(from_name, to_name) || boost::starts_with(to_name, from_name);
const auto name_is_contained = from_name.starts_with(to_name) || to_name.starts_with(from_name);
const auto checkForPrefixOrSuffixChange = [](const std::string_view first,
const std::string_view second,