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

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_r222283444
  
    --- 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;
    --- End diff --
    
    I think this is reasonable -- for msvc these generate different assembler 
output as ::size generates a cached size, whereas empty does not; however, 
these aren't necessarily hot paths so I appreciate the readability improvement. 


> 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