diff --git a/gobject/gobject.c b/gobject/gobject.c index 3348426a8..d8448fb17 100644 --- a/gobject/gobject.c +++ b/gobject/gobject.c @@ -1492,16 +1492,13 @@ g_object_thaw_notify (GObject *object) } static void -consider_issuing_property_deprecation_warning (const GParamSpec *pspec) +maybe_issue_property_deprecation_warning (const GParamSpec *pspec) { static GHashTable *already_warned_table; static const gchar *enable_diagnostic; static GMutex already_warned_lock; gboolean already; - if (!(pspec->flags & G_PARAM_DEPRECATED)) - return; - if (g_once_init_enter (&enable_diagnostic)) { const gchar *value = g_getenv ("G_ENABLE_DIAGNOSTIC"); @@ -1541,6 +1538,13 @@ consider_issuing_property_deprecation_warning (const GParamSpec *pspec) g_type_name (pspec->owner_type), pspec->name); } +static inline void +consider_issuing_property_deprecation_warning (const GParamSpec *pspec) +{ + if (G_UNLIKELY (pspec->flags & G_PARAM_DEPRECATED)) + maybe_issue_property_deprecation_warning (pspec); +} + static inline void object_get_property (GObject *object, GParamSpec *pspec,