From: Mohammed Sadiq Date: Fri, 11 May 2018 01:39:45 +0000 (+0530) Subject: widget: Avoid an unnecessary check X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~22^2~282 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=33bacb41503c0ee623a2958ed1ffcc80bc716d95;p=gtk4.git widget: Avoid an unnecessary check The preceding loop terminates when either the widget is NULL, or if their type matches. There is no reason to check that again --- diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 59b6409c98..9ff1562367 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -8114,9 +8114,6 @@ gtk_widget_get_ancestor (GtkWidget *widget, while (widget && !g_type_is_a (G_OBJECT_TYPE (widget), widget_type)) widget = widget->priv->parent; - if (!(widget && g_type_is_a (G_OBJECT_TYPE (widget), widget_type))) - return NULL; - return widget; }