From 33bacb41503c0ee623a2958ed1ffcc80bc716d95 Mon Sep 17 00:00:00 2001 From: Mohammed Sadiq Date: Fri, 11 May 2018 07:09:45 +0530 Subject: [PATCH] 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 --- gtk/gtkwidget.c | 3 --- 1 file changed, 3 deletions(-) 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; }