[gtk/wip/otte/dnd: 7/9] dragdest: Simplify function



commit 376b648e7bc7ed1f0f03ac51c7bc7a039ca96be0
Author: Benjamin Otte <otte redhat com>
Date:   Sun Feb 16 18:43:45 2020 +0100

    dragdest: Simplify function
    
    Make it obvious that the functions checks one condition and then the
    other.

 gtk/gtkdragdest.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkdragdest.c b/gtk/gtkdragdest.c
index 9d8489d45e..65d6faad75 100644
--- a/gtk/gtkdragdest.c
+++ b/gtk/gtkdragdest.c
@@ -564,14 +564,10 @@ static gboolean
 gtk_drop_target_accept (GtkDropTarget *dest,
                         GdkDrop       *drop)
 {
-  GdkDragAction dest_actions;
-  GdkDragAction actions;
-
-  dest_actions = gtk_drop_target_get_actions (dest);
-
-  actions = dest_actions & gdk_drop_get_actions (drop);
+  if ((gdk_drop_get_actions (drop) & gtk_drop_target_get_actions (dest)) == 0)
+    return FALSE;
 
-  return actions && gdk_content_formats_match (dest->formats, gdk_drop_get_formats (drop));
+  return gdk_content_formats_match (dest->formats, gdk_drop_get_formats (drop));
 }
 
 static void


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