diff options
author | Anders Broman <anders.broman@ericsson.com> | 2013-10-16 20:02:14 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2013-10-16 20:02:14 +0000 |
commit | 26ad68d45ba377905e88de41fc45e65b3c6f40cf (patch) | |
tree | 574a7eaf6f09180a1bc0011c8ebca0a8b0284cba /capture-pcap-util.c | |
parent | fe5529980670c1ca7664d83ffc12e63e77174020 (diff) | |
download | wireshark-26ad68d45ba377905e88de41fc45e65b3c6f40cf.tar.gz |
Prepend to lists rather than append as that's more efficient.
svn path=/trunk/; revision=52650
Diffstat (limited to 'capture-pcap-util.c')
-rw-r--r-- | capture-pcap-util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/capture-pcap-util.c b/capture-pcap-util.c index 87d49cf958..52c984912f 100644 --- a/capture-pcap-util.c +++ b/capture-pcap-util.c @@ -384,7 +384,7 @@ if_info_add_address(if_info_t *if_info, struct sockaddr *addr) if_addr->ifat_type = IF_AT_IPv4; if_addr->addr.ip4_addr = *((guint32 *)&(ai->sin_addr.s_addr)); - if_info->addrs = g_slist_append(if_info->addrs, if_addr); + if_info->addrs = g_slist_prepend(if_info->addrs, if_addr); break; #ifdef INET6 @@ -395,7 +395,7 @@ if_info_add_address(if_info_t *if_info, struct sockaddr *addr) memcpy((void *)&if_addr->addr.ip6_addr, (void *)&ai6->sin6_addr.s6_addr, sizeof if_addr->addr.ip6_addr); - if_info->addrs = g_slist_append(if_info->addrs, if_addr); + if_info->addrs = g_slist_prepend(if_info->addrs, if_addr); break; #endif } |