This is an automated email from the ASF dual-hosted git repository. martinzink pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
commit 62061a136c3966f4bbe6f79ff66ba6f7e243f4eb Author: Adam Debreceni <[email protected]> AuthorDate: Thu Dec 15 16:41:48 2022 +0100 MINIFICPP-2017 - Use std::string_view in join Closes #1478 Signed-off-by: Martin Zink <[email protected]> --- extensions/standard-processors/processors/RouteText.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/extensions/standard-processors/processors/RouteText.cpp b/extensions/standard-processors/processors/RouteText.cpp index 98f5af206..ecb045b90 100644 --- a/extensions/standard-processors/processors/RouteText.cpp +++ b/extensions/standard-processors/processors/RouteText.cpp @@ -427,15 +427,11 @@ std::optional<std::string> RouteText::getGroup(const std::string_view& segment) if (!utils::regexMatch(segment_str, match_result, group_regex_.value())) { return group_fallback_; } - // WARNING!! using a temporary std::string causes the omission of delimiters - // in the output on Windows - const std::string comma = ", "; // unused capturing groups default to empty string auto to_string = [] (const auto& submatch) -> std::string {return submatch;}; return ranges::views::tail(match_result) // only join the capture groups | ranges::views::transform(to_string) - | ranges::views::cache1 - | ranges::views::join(comma) + | ranges::views::join(std::string_view(", ")) | ranges::to<std::string>(); }
