Commit 198c01e0 authored by Simon Giesecke's avatar Simon Giesecke

Use more structured for loop instead of while loop

parent e4b4372c
...@@ -640,12 +640,10 @@ int zmq::ip_resolver_t::resolve_nic_name (ip_addr_t *ip_addr_, const char *nic_) ...@@ -640,12 +640,10 @@ int zmq::ip_resolver_t::resolve_nic_name (ip_addr_t *ip_addr_, const char *nic_)
if (((str_rc1 == 0) && (!strcmp (nic_, if_name))) if (((str_rc1 == 0) && (!strcmp (nic_, if_name)))
|| ((str_rc2 == 0) && (!strcmp (nic_, if_friendly_name)))) { || ((str_rc2 == 0) && (!strcmp (nic_, if_friendly_name)))) {
// Iterate over all unicast addresses bound to the current network interface // Iterate over all unicast addresses bound to the current network interface
IP_ADAPTER_UNICAST_ADDRESS *unicast_address = for (const IP_ADAPTER_UNICAST_ADDRESS *current_unicast_address =
current_addresses->FirstUnicastAddress; current_addresses->FirstUnicastAddress;
IP_ADAPTER_UNICAST_ADDRESS *current_unicast_address = current_unicast_address;
unicast_address; current_unicast_address = current_unicast_address->Next) {
while (current_unicast_address) {
const ADDRESS_FAMILY family = const ADDRESS_FAMILY family =
current_unicast_address->Address.lpSockaddr->sa_family; current_unicast_address->Address.lpSockaddr->sa_family;
...@@ -657,8 +655,6 @@ int zmq::ip_resolver_t::resolve_nic_name (ip_addr_t *ip_addr_, const char *nic_) ...@@ -657,8 +655,6 @@ int zmq::ip_resolver_t::resolve_nic_name (ip_addr_t *ip_addr_, const char *nic_)
found = true; found = true;
break; break;
} }
current_unicast_address = current_unicast_address->Next;
} }
if (found) if (found)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment