diff options
author | Thomas Haller <thaller@redhat.com> | 2016-03-20 10:59:37 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-03-20 10:59:46 +0100 |
commit | 60cc501a665ad7fcfedcdba37557860458dca9a9 (patch) | |
tree | 3218cfc797188e619ce7c47f0f098b93cce8d28d | |
parent | 6c12f04e87b439832bdbac57bc8bd85e369a0bc9 (diff) | |
download | NetworkManager-60cc501a665ad7fcfedcdba37557860458dca9a9.tar.gz |
device: optimize hashtable usage for shared_ips
No point ins storing "TRUE" as value in the @shared_ips hash
table. That forces glib to allocate a separate storage for the
value. Just use g_hash_table_add() instead.
-rw-r--r-- | src/devices/nm-device.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index f4e2ce172b..f18b9c147f 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -4672,10 +4672,7 @@ reserve_shared_ip (NMDevice *self, NMSettingIPConfig *s_ip4, NMPlatformIP4Addres } } nm_platform_ip4_address_set_addr (address, start + count, 24); - - g_hash_table_insert (shared_ips, - GUINT_TO_POINTER (address->address), - GUINT_TO_POINTER (TRUE)); + g_hash_table_add (shared_ips, GUINT_TO_POINTER (address->address)); } return TRUE; |