From c69c70cf5fc6a10d3c03b6e0f581ac9b0b0885b4 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sat, 6 Mar 2021 19:30:09 +0300 Subject: [PATCH] Another minor fix for fmt::split Doesn't affect existing code. If there are 2 or more separator, choose closest. --- Utilities/StrFmt.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Utilities/StrFmt.cpp b/Utilities/StrFmt.cpp index ea9c9b3600..b5f76e7a86 100644 --- a/Utilities/StrFmt.cpp +++ b/Utilities/StrFmt.cpp @@ -429,11 +429,10 @@ std::vector fmt::split(std::string_view source, std::initializer_li for (auto& separator : separators) { - if (usz pos0 = source.find(separator, index); pos0 != umax) + if (usz pos0 = source.find(separator, index); pos0 < pos) { pos = pos0; sep_size = separator.size(); - break; } }