summaryrefslogtreecommitdiff
path: root/gtk/gtkboxlayout.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2020-07-17 06:31:57 +0200
committerTimm Bäder <mail@baedert.org>2020-07-17 06:31:57 +0200
commitc1f5153f6d319b5bd0b6576e6f0ca93d677f23f2 (patch)
tree7a483a4d72f43d0c5c13cbb7e1fc387efbc1182c /gtk/gtkboxlayout.c
parent2bd87ce771d695343bb9472aaa43ea439d331e26 (diff)
downloadgtk+-c1f5153f6d319b5bd0b6576e6f0ca93d677f23f2.tar.gz
boxlayout: Remove unnecessary checks
The pointers passed to GtkLayoutManager::measure() are never NULL. The ones passed to gtk_layout_manager_measure() can be, however.
Diffstat (limited to 'gtk/gtkboxlayout.c')
-rw-r--r--gtk/gtkboxlayout.c19
1 files 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