martinzink commented on code in PR #1987:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1987#discussion_r2480785977


##########
extensions/python/ExecutePythonProcessor.cpp:
##########
@@ -38,9 +38,15 @@ namespace 
org::apache::nifi::minifi::extensions::python::processors {
 
 void ExecutePythonProcessor::initialize() {
   initializeScript();
-  std::vector<core::PropertyReference> all_properties;
-  ranges::transform(python_properties_, std::back_inserter(all_properties), 
&core::Property::getReference);
-  setSupportedProperties(all_properties);
+  std::vector<core::Property> all_properties;
+  all_properties.reserve(Properties.size() + python_properties_.size());
+  for (auto& property : Properties) {
+    all_properties.emplace_back(property);
+  }
+  for (auto& python_property : python_properties_) {
+    all_properties.emplace_back(python_property);
+  }
+  setSupportedProperties(gsl::make_span(all_properties));

Review Comment:
   I think this was my change, due to clang tidy asking for reserving the 
vector beforehand. I wasnt aware that we are delibertly skipping the Properties 
it felt like a oversight given the **all_properties** name. If we only want to 
use python_properties we should keep the prereservation and add an explanatory 
comment and maybe rename all_properties?



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