popover: Remove useless if case
authorTimm Bäder <mail@baedert.org>
Sat, 3 Jun 2017 12:38:56 +0000 (14:38 +0200)
committerRaspbian forward porter <root@raspbian.org>
Wed, 22 Nov 2023 04:54:09 +0000 (04:54 +0000)
rect is not nullable, so stop checking if it is NULL and instead add a
g_return_val_if_fail guard.

Origin: 3.24.39, commit:ad07e9043f36319ae2d733a8d5d0ef89ee9a7586

Gbp-Pq: Name popover-Remove-useless-if-case.patch

gtk/gtkpopover.c

index 45680d0b4b7b1e9547949f140900a84305ee6f8a..82ad2fc29183251626d3442f2311a6d30a92317e 100644 (file)
@@ -2327,16 +2327,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;