szaszm commented on code in PR #1362:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1362#discussion_r911156740


##########
extensions/librdkafka/PublishKafka.cpp:
##########
@@ -184,12 +184,12 @@ class ReadCallback {
     });
   }
 
-  static rd_kafka_headers_unique_ptr make_headers(const core::FlowFile& 
flow_file, utils::Regex& attribute_name_regex) {
+  static rd_kafka_headers_unique_ptr make_headers(const core::FlowFile& 
flow_file, std::optional<utils::Regex>& attribute_name_regex) {
     const gsl::owner<rd_kafka_headers_t*> result{ rd_kafka_headers_new(8) };
     if (!result) { throw std::bad_alloc{}; }
 
     for (const auto& kv : flow_file.getAttributes()) {
-      if (utils::regexSearch(kv.first, attribute_name_regex)) {
+      if (attribute_name_regex && utils::regexSearch(kv.first, 
*attribute_name_regex)) {

Review Comment:
   Wherever regexSearch is used over regexMatch, we should check if it really 
makes sense to use subsequence matching.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to