summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-02-09 12:36:06 +0100
committerThomas Haller <thaller@redhat.com>2018-02-09 17:40:01 +0100
commit339d68dd8e36b7e556c58b20dc02acc86b1057f9 (patch)
tree5673b5828e7a6e1411cd3267191da40b1085f066
parent7e208c1d288dc4ee95e0d3695245bc1511078e69 (diff)
downloadNetworkManager-339d68dd8e36b7e556c58b20dc02acc86b1057f9.tar.gz
device: use g_slist_prepend() to track dad6_failed_addrs
The order in which we add addresses to dad6_failed_addrs does not matter. Hence, use g_slist_prepend() which is O(1), instead g_slist_append() with O(n).
-rw-r--r--src/devices/nm-device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 4526765a92..d0a1743c82 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -11645,8 +11645,8 @@ device_ipx_changed (NMPlatform *platform,
&& priv->state < NM_DEVICE_STATE_DEACTIVATING
&& ( (change_type == NM_PLATFORM_SIGNAL_CHANGED && addr->n_ifa_flags & IFA_F_DADFAILED)
|| (change_type == NM_PLATFORM_SIGNAL_REMOVED && addr->n_ifa_flags & IFA_F_TENTATIVE))) {
- priv->dad6_failed_addrs = g_slist_append (priv->dad6_failed_addrs,
- g_memdup (addr, sizeof (NMPlatformIP6Address)));
+ priv->dad6_failed_addrs = g_slist_prepend (priv->dad6_failed_addrs,
+ g_memdup (addr, sizeof (NMPlatformIP6Address)));
}
/* fall through */
case NMP_OBJECT_TYPE_IP6_ROUTE: