Skip to content

Commit

Permalink
Revert: Add missing return statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Bidski committed Jan 8, 2024
1 parent 73556c8 commit 9e04554
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions src/nuclear/src/extension/network/NUClearNetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ namespace extension {
case AF_INET6: return sizeof(sockaddr_in6);
default: throw std::runtime_error("unhandled socket address family");
}
return {};
}

NUClearNetwork::PacketQueue::PacketTarget::PacketTarget(std::weak_ptr<NetworkTarget> target,
Expand Down Expand Up @@ -173,9 +172,7 @@ namespace extension {

// Swap our address so the rest of the information is anys
if (address.sock.sa_family == AF_INET) { address.ipv4.sin_addr.s_addr = htonl(INADDR_ANY); }
else if (address.sock.sa_family == AF_INET6) {
address.ipv6.sin6_addr = IN6ADDR_ANY_INIT;
}
else if (address.sock.sa_family == AF_INET6) { address.ipv6.sin6_addr = IN6ADDR_ANY_INIT; }

// Make our socket
announce_fd = ::socket(address.sock.sa_family, SOCK_DGRAM, IPPROTO_UDP);
Expand Down Expand Up @@ -234,9 +231,7 @@ namespace extension {
sizeof(ip_mreq));

if (status < 0) { last_network_errno = network_errno; }
else {
connected_count++;
}
else { connected_count++; }
}
}

Expand Down Expand Up @@ -554,15 +549,11 @@ namespace extension {
++it;
}
// Remove them from the list
else {
it = qit->second.targets.erase(it);
}
else { it = qit->second.targets.erase(it); }
}

if (qit->second.targets.empty()) { qit = send_queue.erase(qit); }
else {
++qit;
}
else { ++qit; }
}
}

Expand Down Expand Up @@ -649,9 +640,7 @@ namespace extension {
}
}
// They're old but at least they're not timing out
else {
remote->last_update = std::chrono::steady_clock::now();
}
else { remote->last_update = std::chrono::steady_clock::now(); }
} break;
case LEAVE: {

Expand Down

0 comments on commit 9e04554

Please sign in to comment.