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
This commit is contained in:
Mohammed Sadiq 2018-05-11 07:09:45 +05:30
parent 47872e5172
commit 33bacb4150

View File

@ -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;
}