[ 
https://issues.apache.org/jira/browse/MINIFICPP-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16636885#comment-16636885
 ] 

ASF GitHub Bot commented on MINIFICPP-627:
------------------------------------------

Github user phrocker commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/408#discussion_r222284464
  
    --- Diff: libminifi/src/c2/protocols/RESTProtocol.cpp ---
    @@ -160,12 +160,12 @@ rapidjson::Value RESTProtocol::getStringValue(const 
std::string& value, rapidjso
     
     void RESTProtocol::mergePayloadContent(rapidjson::Value &target, const 
C2Payload &payload, rapidjson::Document::AllocatorType &alloc) {
       const std::vector<C2ContentResponse> &content = payload.getContent();
    -  bool all_empty = content.size() > 0 ? true : false;
    +  bool all_empty = !content.empty();
       bool is_parent_array = target.IsArray();
     
       for (const auto &payload_content : content) {
    -    for (auto content : payload_content.operation_arguments) {
    --- End diff --
    
    Good catch. I missed this when reviewing and merging these changes. 


> Remove unnecessary ternary operators, variable shadowing
> --------------------------------------------------------
>
>                 Key: MINIFICPP-627
>                 URL: https://issues.apache.org/jira/browse/MINIFICPP-627
>             Project: NiFi MiNiFi C++
>          Issue Type: Improvement
>            Reporter: Arpad Boda
>            Assignee: Arpad Boda
>            Priority: Trivial
>
> There are some "? true : false" operations in the code, which is unnecessary. 
> Variable shadowing are to be removed to reduce the possibility of errors when 
> touching the code. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to