[gtk+] ScrolledWindow: Bin unreachable ternary branches



commit ad5c4d09b3eed2cf125373afb66a2d31e00591a0
Author: Daniel Boles <dboles src gnome org>
Date:   Tue Aug 15 15:15:08 2017 +0100

    ScrolledWindow: Bin unreachable ternary branches
    
    We already checked that the child is not NULL above.
    
    Coverity CID 1454191

 gtk/gtkscrolledwindow.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 2ab0e59..a30ee06 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -1390,19 +1390,12 @@ gtk_scrolled_window_size_allocate (GtkWidget           *widget,
     {
       gint child_scroll_width;
       gint child_scroll_height;
-      GtkScrollablePolicy hscroll_policy;
-      GtkScrollablePolicy vscroll_policy;
       gboolean previous_hvis;
       gboolean previous_vvis;
       guint count = 0;
       GtkScrollable *scrollable_child = GTK_SCROLLABLE (child);
-
-      hscroll_policy = scrollable_child != NULL
-                       ? gtk_scrollable_get_hscroll_policy (scrollable_child)
-                       : GTK_SCROLL_MINIMUM;
-      vscroll_policy = scrollable_child != NULL
-                       ? gtk_scrollable_get_vscroll_policy (scrollable_child)
-                       : GTK_SCROLL_MINIMUM;
+      GtkScrollablePolicy hscroll_policy = gtk_scrollable_get_hscroll_policy (scrollable_child);
+      GtkScrollablePolicy vscroll_policy = gtk_scrollable_get_vscroll_policy (scrollable_child);
 
       /* Determine scrollbar visibility first via hfw apis */
       if (gtk_widget_get_request_mode (child) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH)


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