You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2022/12/15 15:50:34 UTC
[nifi-minifi-cpp] 02/02: MINIFICPP-2017 - Use std::string_view in join
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 <ad...@apache.org>
AuthorDate: Thu Dec 15 16:41:48 2022 +0100
MINIFICPP-2017 - Use std::string_view in join
Closes #1478
Signed-off-by: Martin Zink <ma...@apache.org>
---
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>();
}