[gtk+/client-side-windows] Simplify _gdk_display_get_last_pointer_grab using g_list_last



commit ca06216f2087c82512b999d3c28b10dd264b4619
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Jun 24 20:20:33 2009 +0200

    Simplify _gdk_display_get_last_pointer_grab using g_list_last

 gdk/gdkdisplay.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index f6f9743..6589e15 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -749,15 +749,12 @@ _gdk_display_get_last_pointer_grab (GdkDisplay *display)
 {
   GList *l;
 
-  l = display->pointer_grabs;
+  l = g_list_last (display->pointer_grabs);
 
   if (l == NULL)
     return NULL;
-
-  while (l->next != NULL)
-    l = l->next;
-
-  return (GdkPointerGrabInfo *)l->data;
+  else
+    return (GdkPointerGrabInfo *)l->data;
 }
 
 



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