hunyadi-dev commented on a change in pull request #940: URL: https://github.com/apache/nifi-minifi-cpp/pull/940#discussion_r553788782
########## File path: libminifi/src/utils/StringUtils.cpp ########## @@ -46,8 +46,13 @@ std::string StringUtils::trim(const std::string& s) { return trimRight(trimLeft(s)); } -std::vector<std::string> StringUtils::split(const std::string &str, const std::string &delimiter) { +template<typename Fun> +std::vector<std::string> split_transformed(const std::string& str, const std::string& delimiter, Fun transformation) { std::vector<std::string> result; + if (delimiter.empty()) { + std::transform(str.begin(), str.end(), std::back_inserter(result), [] (const char c) { return std::string{c}; }); Review comment: Updated. ########## File path: libminifi/src/utils/StringUtils.cpp ########## @@ -46,8 +46,13 @@ std::string StringUtils::trim(const std::string& s) { return trimRight(trimLeft(s)); } -std::vector<std::string> StringUtils::split(const std::string &str, const std::string &delimiter) { +template<typename Fun> +std::vector<std::string> split_transformed(const std::string& str, const std::string& delimiter, Fun transformation) { std::vector<std::string> result; + if (delimiter.empty()) { + std::transform(str.begin(), str.end(), std::back_inserter(result), [] (const char c) { return std::string{c}; }); Review comment: Fixed. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org