[gtk+/wip/baedert/drawing: 137/142] popover: Remove useless if case



commit 384c0b090e6ab7d45f91f3718c64640519af5068
Author: Timm Bäder <mail baedert org>
Date:   Sat Jun 3 14:38:56 2017 +0200

    popover: Remove useless if case
    
    rect is not nullable, so stop checking if it is NULL and instead add a
    g_return_val_if_fail guard.

 gtk/gtkpopover.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 2f866c9..84ce4e5 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -2121,16 +2121,14 @@ gtk_popover_get_pointing_to (GtkPopover   *popover,
   GtkPopoverPrivate *priv = gtk_popover_get_instance_private (popover);
 
   g_return_val_if_fail (GTK_IS_POPOVER (popover), FALSE);
+  g_return_val_if_fail (rect != NULL, FALSE);
 
-  if (rect)
+  if (priv->has_pointing_to)
+    *rect = priv->pointing_to;
+  else if (priv->widget)
     {
-      if (priv->has_pointing_to)
-        *rect = priv->pointing_to;
-      else if (priv->widget)
-        {
-          gtk_widget_get_allocation (priv->widget, rect);
-          rect->x = rect->y = 0;
-        }
+      gtk_widget_get_allocation (priv->widget, rect);
+      rect->x = rect->y = 0;
     }
 
   return priv->has_pointing_to;


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