Another minor fix for fmt::split

Doesn't affect existing code.
If there are 2 or more separator, choose closest.
This commit is contained in:
Nekotekina 2021-03-06 19:30:09 +03:00
parent 7cd79714fa
commit c69c70cf5f

View File

@ -429,11 +429,10 @@ std::vector<std::string> fmt::split(std::string_view source, std::initializer_li
for (auto& separator : separators) for (auto& separator : separators)
{ {
if (usz pos0 = source.find(separator, index); pos0 != umax) if (usz pos0 = source.find(separator, index); pos0 < pos)
{ {
pos = pos0; pos = pos0;
sep_size = separator.size(); sep_size = separator.size();
break;
} }
} }