Github user achristianson commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/346#discussion_r191486681
--- 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;
--- End diff --
Why not just return io::NetworkInterface(ifc, shared_from_this())?
---