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

    https://github.com/apache/nifi-minifi-cpp/pull/346#discussion_r191489985
  
    --- Diff: libminifi/src/controllers/NetworkPrioritizerService.cpp ---
    @@ -65,33 +65,38 @@ void NetworkPrioritizerService::yield() {
     /**
      * If not an intersecting operation we will attempt to locate the highest 
priority interface available.
      */
    -io::NetworkInterface &&NetworkPrioritizerService::getInterface(uint32_t 
size = 0) {
    +io::NetworkInterface NetworkPrioritizerService::getInterface(uint32_t size 
= 0) {
       std::vector<std::string> controllers;
    +  std::string ifc = "";
       if (!network_controllers_.empty()) {
         if (sufficient_tokens(size) && size < max_payload_) {
           controllers.insert(std::end(controllers), 
std::begin(network_controllers_), std::end(network_controllers_));
         }
       }
     
       if (!controllers.empty()) {
    -    auto ifc = get_nearest_interface(controllers);
    +    ifc = get_nearest_interface(controllers);
         if (!ifc.empty()) {
           reduce_tokens(size);
    -      return std::move(io::NetworkInterface(ifc, shared_from_this()));
    +      io::NetworkInterface newifc(ifc, shared_from_this());
    +      return newifc;
         }
       }
       for (size_t i = 0; i < linked_services_.size(); i++) {
         auto np = 
std::dynamic_pointer_cast<NetworkPrioritizerService>(linked_services_.at(i));
         if (np != nullptr) {
           auto ifcs = np->getInterfaces(size);
    -      auto ifc = get_nearest_interface(ifcs);
    +      ifc = get_nearest_interface(ifcs);
           if (!ifc.empty()) {
             np->reduce_tokens(size);
    -        return std::move(io::NetworkInterface(ifc, np));
    +        io::NetworkInterface newifc(ifc, np);
    +        return newifc;
    --- End diff --
    
    same explanation as above. net result in the assembly is different in only 
that RVO isn't occurring with ifc. 


---

Reply via email to