diff options
author | Thomas Haller <thaller@redhat.com> | 2017-02-02 18:53:49 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-02-10 14:33:52 +0100 |
commit | 8538b61eb6690486a6245d3f3a1eb075c4f5fb35 (patch) | |
tree | d6bf9f20a0356b7d82c1b63dbdcf19f5a3076172 /src/supplicant/nm-supplicant-interface.c | |
parent | 23040d68fc02f826c13533c1cd2dcf233ca341ec (diff) |
core: use cached GQuark and g_object_[gs]et_qdata()
Use g_object_[gs]et_qdata() instead of g_object_[gs]et_data() with a cached
quark. This saves an additional lookup to intern the string.
Diffstat (limited to 'src/supplicant/nm-supplicant-interface.c')
-rw-r--r-- | src/supplicant/nm-supplicant-interface.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/supplicant/nm-supplicant-interface.c b/src/supplicant/nm-supplicant-interface.c index c913a6960..70f05e1c9 100644 --- a/src/supplicant/nm-supplicant-interface.c +++ b/src/supplicant/nm-supplicant-interface.c @@ -37,6 +37,8 @@ #define WPAS_ERROR_INVALID_IFACE WPAS_DBUS_INTERFACE ".InvalidInterface" #define WPAS_ERROR_EXISTS_ERROR WPAS_DBUS_INTERFACE ".InterfaceExists" +static NM_CACHED_QUARK_FCN ("bss-proxy-inited", bss_proxy_inited_quark) + /*****************************************************************************/ enum { @@ -177,8 +179,6 @@ _get_bss_proxy_properties (NMSupplicantInterface *self, GDBusProxy *proxy) return g_variant_builder_end (&builder); } -#define BSS_PROXY_INITED "bss-proxy-inited" - static void on_bss_proxy_acquired (GDBusProxy *proxy, GAsyncResult *result, gpointer user_data) { @@ -201,7 +201,7 @@ on_bss_proxy_acquired (GDBusProxy *proxy, GAsyncResult *result, gpointer user_da if (!props) return; - g_object_set_data (G_OBJECT (proxy), BSS_PROXY_INITED, GUINT_TO_POINTER (TRUE)); + g_object_set_qdata (G_OBJECT (proxy), bss_proxy_inited_quark (), GUINT_TO_POINTER (TRUE)); g_signal_emit (self, signals[NEW_BSS], 0, g_dbus_proxy_get_object_path (proxy), @@ -567,7 +567,7 @@ wpas_iface_scan_done (GDBusProxy *proxy, /* Emit NEW_BSS so that wifi device has the APs (in case it removed them) */ g_hash_table_iter_init (&iter, priv->bss_proxies); while (g_hash_table_iter_next (&iter, (gpointer) &bss_path, (gpointer) &bss_proxy)) { - if (g_object_get_data (G_OBJECT (bss_proxy), BSS_PROXY_INITED)) { + if (g_object_get_qdata (G_OBJECT (bss_proxy), bss_proxy_inited_quark ())) { props = _get_bss_proxy_properties (self, bss_proxy); if (props) { g_signal_emit (self, signals[NEW_BSS], 0, |