|
|
|
@ -80,13 +80,13 @@ namespace llarp
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<std::string_view>
|
|
|
|
|
split(std::string_view str, char delimiter)
|
|
|
|
|
split(const std::string_view str, char delimiter)
|
|
|
|
|
{
|
|
|
|
|
std::vector<std::string_view> splits;
|
|
|
|
|
|
|
|
|
|
const auto str_size = str.size();
|
|
|
|
|
size_t last = 0;
|
|
|
|
|
size_t next = 0;
|
|
|
|
|
while (last < str.size() and next < std::string_view::npos)
|
|
|
|
|
while (last < str_size and next < std::string_view::npos)
|
|
|
|
|
{
|
|
|
|
|
next = str.find_first_of(delimiter, last);
|
|
|
|
|
if (next > last)
|
|
|
|
@ -96,7 +96,7 @@ namespace llarp
|
|
|
|
|
last = next;
|
|
|
|
|
|
|
|
|
|
// advance to next non-delimiter
|
|
|
|
|
while (str[last] == delimiter)
|
|
|
|
|
while (str[last] == delimiter and last < str_size)
|
|
|
|
|
last++;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|