[gtk+] listbox: Remove unneeded checks
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] listbox: Remove unneeded checks
- Date: Thu, 1 May 2014 13:15:44 +0000 (UTC)
commit d7a3e67025cf8909b0b19475d1febe8870758334
Author: Benjamin Otte <otte redhat com>
Date: Wed Apr 30 09:19:33 2014 +0200
listbox: Remove unneeded checks
Size vfuncs always get non-null out variables passed, so no need to
check for NULL.
gtk/gtklistbox.c | 26 ++++++++------------------
1 files changed, 8 insertions(+), 18 deletions(-)
---
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index f60a7f8..6fb9e25 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -2296,7 +2296,6 @@ gtk_list_box_get_preferred_height_for_width (GtkWidget *widget,
GtkListBoxPrivate *priv = BOX_PRIV (widget);
GSequenceIter *iter;
gint minimum_height;
- gint natural_height;
minimum_height = 0;
@@ -2327,11 +2326,8 @@ gtk_list_box_get_preferred_height_for_width (GtkWidget *widget,
/* We always allocate the minimum height, since handling expanding rows is way too costly,
* and unlikely to be used, as lists are generally put inside a scrolling window anyway.
*/
- natural_height = minimum_height;
- if (minimum_height_out)
- *minimum_height_out = minimum_height;
- if (natural_height_out)
- *natural_height_out = natural_height;
+ *minimum_height_out = minimum_height;
+ *natural_height_out = minimum_height;
}
static void
@@ -2378,10 +2374,8 @@ gtk_list_box_get_preferred_width (GtkWidget *widget,
}
}
- if (minimum_width_out)
- *minimum_width_out = minimum_width;
- if (natural_width_out)
- *natural_width_out = natural_width;
+ *minimum_width_out = minimum_width;
+ *natural_width_out = natural_width;
}
static void
@@ -3002,10 +2996,8 @@ gtk_list_box_row_get_preferred_height_for_width (GtkWidget *widget,
gtk_widget_get_preferred_height_for_width (child, width - full_border.left - full_border.right,
&child_min, &child_natural);
- if (minimum_height_out)
- *minimum_height_out = full_border.top + child_min + full_border.bottom;
- if (natural_height_out)
- *natural_height_out = full_border.top + child_natural + full_border.bottom;
+ *minimum_height_out = full_border.top + child_min + full_border.bottom;
+ *natural_height_out = full_border.top + child_natural + full_border.bottom;
}
static void
@@ -3025,10 +3017,8 @@ gtk_list_box_row_get_preferred_width (GtkWidget *widget,
gtk_widget_get_preferred_width (child,
&child_min, &child_natural);
- if (minimum_width_out)
- *minimum_width_out = full_border.left + child_min + full_border.right;
- if (natural_width_out)
- *natural_width_out = full_border.left + child_natural + full_border.bottom;
+ *minimum_width_out = full_border.left + child_min + full_border.right;
+ *natural_width_out = full_border.left + child_natural + full_border.bottom;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]