mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 14:36:16 +01:00
gsignal: Fold g_quark_try_string() call into signal_id_lookup()
This eliminates a call from every call site of signal_id_lookup(). It introduces no functional changes, but allows subsequent refactoring. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
parent
b8eb6025f1
commit
90b51805b7
@ -145,8 +145,8 @@ typedef enum
|
|||||||
|
|
||||||
|
|
||||||
/* --- prototypes --- */
|
/* --- prototypes --- */
|
||||||
static inline guint signal_id_lookup (GQuark quark,
|
static inline guint signal_id_lookup (const gchar *name,
|
||||||
GType itype);
|
GType itype);
|
||||||
static void signal_destroy_R (SignalNode *signal_node);
|
static void signal_destroy_R (SignalNode *signal_node);
|
||||||
static inline HandlerList* handler_list_ensure (guint signal_id,
|
static inline HandlerList* handler_list_ensure (guint signal_id,
|
||||||
gpointer instance);
|
gpointer instance);
|
||||||
@ -341,13 +341,15 @@ LOOKUP_SIGNAL_NODE (guint signal_id)
|
|||||||
|
|
||||||
/* --- functions --- */
|
/* --- functions --- */
|
||||||
static inline guint
|
static inline guint
|
||||||
signal_id_lookup (GQuark quark,
|
signal_id_lookup (const gchar *name,
|
||||||
GType itype)
|
GType itype)
|
||||||
{
|
{
|
||||||
|
GQuark quark;
|
||||||
GType *ifaces, type = itype;
|
GType *ifaces, type = itype;
|
||||||
SignalKey key;
|
SignalKey key;
|
||||||
guint n_ifaces;
|
guint n_ifaces;
|
||||||
|
|
||||||
|
quark = g_quark_try_string (name);
|
||||||
key.quark = quark;
|
key.quark = quark;
|
||||||
|
|
||||||
/* try looking up signals for this type and its ancestors */
|
/* try looking up signals for this type and its ancestors */
|
||||||
@ -1080,7 +1082,7 @@ signal_parse_name (const gchar *name,
|
|||||||
|
|
||||||
if (!colon)
|
if (!colon)
|
||||||
{
|
{
|
||||||
signal_id = signal_id_lookup (g_quark_try_string (name), itype);
|
signal_id = signal_id_lookup (name, itype);
|
||||||
if (signal_id && detail_p)
|
if (signal_id && detail_p)
|
||||||
*detail_p = 0;
|
*detail_p = 0;
|
||||||
}
|
}
|
||||||
@ -1093,7 +1095,7 @@ signal_parse_name (const gchar *name,
|
|||||||
{
|
{
|
||||||
memcpy (buffer, name, l);
|
memcpy (buffer, name, l);
|
||||||
buffer[l] = 0;
|
buffer[l] = 0;
|
||||||
signal_id = signal_id_lookup (g_quark_try_string (buffer), itype);
|
signal_id = signal_id_lookup (buffer, itype);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1101,7 +1103,7 @@ signal_parse_name (const gchar *name,
|
|||||||
|
|
||||||
memcpy (signal, name, l);
|
memcpy (signal, name, l);
|
||||||
signal[l] = 0;
|
signal[l] = 0;
|
||||||
signal_id = signal_id_lookup (g_quark_try_string (signal), itype);
|
signal_id = signal_id_lookup (signal, itype);
|
||||||
g_free (signal);
|
g_free (signal);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1241,7 +1243,7 @@ g_signal_lookup (const gchar *name,
|
|||||||
g_return_val_if_fail (G_TYPE_IS_INSTANTIATABLE (itype) || G_TYPE_IS_INTERFACE (itype), 0);
|
g_return_val_if_fail (G_TYPE_IS_INSTANTIATABLE (itype) || G_TYPE_IS_INTERFACE (itype), 0);
|
||||||
|
|
||||||
SIGNAL_LOCK ();
|
SIGNAL_LOCK ();
|
||||||
signal_id = signal_id_lookup (g_quark_try_string (name), itype);
|
signal_id = signal_id_lookup (name, itype);
|
||||||
SIGNAL_UNLOCK ();
|
SIGNAL_UNLOCK ();
|
||||||
if (!signal_id)
|
if (!signal_id)
|
||||||
{
|
{
|
||||||
@ -1658,7 +1660,7 @@ g_signal_newv (const gchar *signal_name,
|
|||||||
|
|
||||||
SIGNAL_LOCK ();
|
SIGNAL_LOCK ();
|
||||||
|
|
||||||
signal_id = signal_id_lookup (g_quark_try_string (name), itype);
|
signal_id = signal_id_lookup (name, itype);
|
||||||
node = LOOKUP_SIGNAL_NODE (signal_id);
|
node = LOOKUP_SIGNAL_NODE (signal_id);
|
||||||
if (node && !node->destroyed)
|
if (node && !node->destroyed)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user