Skip to content

Commit

Permalink
refactor: Drop boost/algorithm/string/replace.hpp dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Aug 8, 2022
1 parent 857526e commit fea75ad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/util/string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

#include <util/string.h>

#include <boost/algorithm/string/replace.hpp>

#include <regex>
#include <string>
#include <utility>

void ReplaceAll(std::string& in_out, std::string_view search, std::string_view substitute)
void ReplaceAll(std::string& in_out, const std::string& search, const std::string& substitute)
{
boost::replace_all(in_out, search, substitute);
if (search.empty()) return;
in_out = std::regex_replace(in_out, std::regex(std::move(search)), substitute);
}
2 changes: 1 addition & 1 deletion src/util/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <string_view>
#include <vector>

void ReplaceAll(std::string& in_out, std::string_view search, std::string_view substitute);
void ReplaceAll(std::string& in_out, const std::string& search, const std::string& substitute);

[[nodiscard]] inline std::vector<std::string> SplitString(std::string_view str, char sep)
{
Expand Down
3 changes: 1 addition & 2 deletions test/lint/lint-includes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
"src/minisketch/",
]

EXPECTED_BOOST_INCLUDES = ["boost/algorithm/string/replace.hpp",
"boost/date_time/posix_time/posix_time.hpp",
EXPECTED_BOOST_INCLUDES = ["boost/date_time/posix_time/posix_time.hpp",
"boost/multi_index/hashed_index.hpp",
"boost/multi_index/ordered_index.hpp",
"boost/multi_index/sequenced_index.hpp",
Expand Down

0 comments on commit fea75ad

Please sign in to comment.