[gtk/wip/otte/dnd: 2/10] dragdest: Simplify function



commit 3a7e3cf90d265330e0dc75d733b5be19c8b617c6
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]