updated build system
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
This commit is contained in:
5
support/3rd_party/include/utils/string.hpp
vendored
5
support/3rd_party/include/utils/string.hpp
vendored
@@ -323,7 +323,7 @@ template <typename string_t>
|
||||
inline auto replace(string_t &src, typename string_t::value_type character,
|
||||
typename string_t::value_type with,
|
||||
std::size_t start_pos) -> string_t & {
|
||||
if (not src.empty() && (start_pos < src.size())) {
|
||||
if (start_pos < src.size()) {
|
||||
std::replace(std::next(src.begin(), start_pos), src.end(), character, with);
|
||||
}
|
||||
|
||||
@@ -335,12 +335,13 @@ inline auto replace(string_t &src,
|
||||
std::basic_string_view<typename string_t::value_type> find,
|
||||
std::basic_string_view<typename string_t::value_type> with,
|
||||
std::size_t start_pos) -> string_t & {
|
||||
if (not src.empty() && (start_pos < src.size())) {
|
||||
if (start_pos < src.size()) {
|
||||
while ((start_pos = src.find(find, start_pos)) != string_t::npos) {
|
||||
src.replace(start_pos, find.size(), with);
|
||||
start_pos += with.size();
|
||||
}
|
||||
}
|
||||
|
||||
return src;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user