hunyadi-dev commented on a change in pull request #1040:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1040#discussion_r607779530



##########
File path: extensions/standard-processors/processors/GetTCP.cpp
##########
@@ -130,7 +130,7 @@ void GetTCP::onSchedule(const 
std::shared_ptr<core::ProcessContext> &context, co
   }
 
   if (context->getProperty(StayConnected.getName(), value)) {
-    utils::StringUtils::StringToBool(value, stay_connected_);
+    stay_connected_ = utils::StringUtils::toBool(value).value_or(false);

Review comment:
       I think that is not the right conclusion. As Feri said, you should move 
the default value assignment right before this check and make the "default" 
argument of `value_or` true.
   
   This should be equivalent but a bit less readable:
   ```c++
   stay_connected_ = (!context->getProperty(StayConnected.getName(), value)) || 
utils::StringUtils::toBool(value).value_or(true);
   ```




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


Reply via email to