pidgin: 2026210d: This small optimization has been sitting...

datallah at pidgin.im datallah at pidgin.im
Mon Feb 9 23:30:39 EST 2009


-----------------------------------------------------------------
Revision: 2026210de0785811e4681fcc9e988fb8d00601ef
Ancestor: 62602e847acec0723ca97176c40fd6b2f3516b77
Author: datallah at pidgin.im
Date: 2009-02-10T04:25:45
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/2026210de0785811e4681fcc9e988fb8d00601ef

Modified files:
        pidgin/gtkdocklet.c

ChangeLog: 

This small optimization has been sitting in my tree for a long time.

-------------- next part --------------
============================================================
--- pidgin/gtkdocklet.c	c0e40bdb8277634d1236b4100d56e9fc750f1c38
+++ pidgin/gtkdocklet.c	45481378196a661e8862f6ead9e997994d75cc07
@@ -88,13 +88,16 @@ get_pending_list(guint max)
 static GList *
 get_pending_list(guint max)
 {
-	GList *l_im = NULL;
-	GList *l_chat = NULL;
+	GList *l_im, *l_chat;
 
 	l_im = pidgin_conversations_find_unseen_list(PURPLE_CONV_TYPE_IM,
 						       PIDGIN_UNSEEN_TEXT,
 						       FALSE, max);
 
+	/* Short circuit if we have our information already */
+	if (max == 1 && l_im != NULL)
+		return l_im;
+
 	l_chat = pidgin_conversations_find_unseen_list(PURPLE_CONV_TYPE_CHAT,
 		 					 PIDGIN_UNSEEN_NICK,
 							 FALSE, max);


More information about the Commits mailing list