[gtk/wip/baedert/for-master] boxlayout: Remove unnecessary checks



commit c1f5153f6d319b5bd0b6576e6f0ca93d677f23f2
Author: Timm Bäder <mail baedert org>
Date:   Fri Jul 17 06:31:57 2020 +0200

    boxlayout: Remove unnecessary checks
    
    The pointers passed to GtkLayoutManager::measure() are never NULL. The
    ones passed to gtk_layout_manager_measure() can be, however.

 gtk/gtkboxlayout.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtkboxlayout.c b/gtk/gtkboxlayout.c
index c558523a81..042d4084e1 100644
--- a/gtk/gtkboxlayout.c
+++ b/gtk/gtkboxlayout.c
@@ -249,10 +249,8 @@ gtk_box_layout_compute_size (GtkBoxLayout *self,
       required_nat += (n_visible_children - 1) * spacing;
     }
 
-  if (minimum != NULL)
-    *minimum = required_min;
-  if (natural != NULL)
-    *natural = required_nat;
+  *minimum = required_min;
+  *natural = required_nat;
 }
 
 static void
@@ -419,15 +417,10 @@ gtk_box_layout_compute_opposite_size (GtkBoxLayout *self,
         }
     }
 
-  if (minimum != NULL)
-    *minimum = computed_minimum;
-  if (natural != NULL)
-    *natural = MAX (computed_natural, computed_natural_below + computed_natural_above);
-
-  if (min_baseline != NULL)
-    *min_baseline = computed_minimum_baseline;
-  if (nat_baseline != NULL)
-    *nat_baseline = computed_natural_baseline;
+  *minimum = computed_minimum;
+  *natural = MAX (computed_natural, computed_natural_below + computed_natural_above);
+  *min_baseline = computed_minimum_baseline;
+  *nat_baseline = computed_natural_baseline;
 }
 
 static void


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