[gtk/wip/baedert/transforms7: 43/46] widget: Add typecheck-less _is_sensitive



commit 95b851005ac5fea8c463995069e5042cf63b2dfb
Author: Timm Bäder <mail baedert org>
Date:   Tue Feb 19 08:24:43 2019 +0100

    widget: Add typecheck-less _is_sensitive
    
    It adds up to a whopping 3% in gtk_widget_pick

 gtk/gtkwidget.c        | 4 +---
 gtk/gtkwidgetprivate.h | 6 ++++++
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 31ecae3137..ab267b2898 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -6481,11 +6481,9 @@ gtk_widget_get_sensitive (GtkWidget *widget)
 gboolean
 gtk_widget_is_sensitive (GtkWidget *widget)
 {
-  GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
-
   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
 
-  return !(priv->state_flags & GTK_STATE_FLAG_INSENSITIVE);
+  return _gtk_widget_is_sensitive (widget);
 }
 
 
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index 31356ae5a5..ad04290708 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -484,6 +484,12 @@ _gtk_widget_get_last_child (GtkWidget *widget)
   return widget->priv->last_child;
 }
 
+static inline gboolean
+_gtk_widget_is_sensitive (GtkWidget *widget)
+{
+  return !(widget->priv->state_flags & GTK_STATE_FLAG_INSENSITIVE);
+}
+
 G_END_DECLS
 
 #endif /* __GTK_WIDGET_PRIVATE_H__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]