[gtk+/gtk-3-22] combobox: Avoid a pointless assignment



commit eb26b57cba460674e49535b40e573b014ea4ceac
Author: Daniel Boles <dboles src gnome org>
Date:   Thu Jan 19 03:26:09 2017 +0000

    combobox: Avoid a pointless assignment
    
    Don’t get the active item pointer before the grid/non-grid conditional,
    because if we’re in grid mode, we re-get it before selecting it anyway.

 gtk/gtkcombobox.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index fc2273a..55403ea 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -2153,8 +2153,6 @@ gtk_combo_box_menu_popup (GtkComboBox    *combo_box,
 
   g_object_set (priv->popup_widget, "menu-type-hint", GDK_WINDOW_TYPE_HINT_COMBO, NULL);
 
-  active = gtk_menu_get_active (GTK_MENU (priv->popup_widget));
-
   if (priv->wrap_width > 0 || priv->cell_view == NULL)
     {
       gtk_css_gadget_get_border_allocation (priv->gadget, &border_allocation, NULL);
@@ -2180,6 +2178,8 @@ gtk_combo_box_menu_popup (GtkComboBox    *combo_box,
       GList *i;
       GtkWidget *child;
 
+      active = gtk_menu_get_active (GTK_MENU (priv->popup_widget));
+
       if (!(active && gtk_widget_get_visible (active)))
         {
           for (i = GTK_MENU_SHELL (priv->popup_widget)->priv->children; i && !active; i = i->next)


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