[Svn] r3713 - trunk/roundcubemail/program/include

trac at roundcube.net trac at roundcube.net
Fri Jun 4 12:06:10 CEST 2010


Author: alec
Date: 2010-06-04 05:06:10 -0500 (Fri, 04 Jun 2010)
New Revision: 3713

Modified:
   trunk/roundcubemail/program/include/rcube_imap_generic.php
Log:
- performance improvement: we can skip THREAD when folder is empty


Modified: trunk/roundcubemail/program/include/rcube_imap_generic.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_imap_generic.php	2010-06-04 09:58:37 UTC (rev 3712)
+++ trunk/roundcubemail/program/include/rcube_imap_generic.php	2010-06-04 10:06:10 UTC (rev 3713)
@@ -1552,10 +1552,17 @@
 
     function thread($folder, $algorithm='REFERENCES', $criteria='', $encoding='US-ASCII')
     {
+        $old_sel = $this->selected;
+
 	    if (!$this->select($folder)) {
-		    return false;
+    		return false;
 	    }
 
+        // return empty result when folder is empty and we're just after SELECT
+        if ($old_sel != $folder && !$this->exists) {
+            return array(array(), array(), array());
+	    }
+
     	$encoding  = $encoding ? trim($encoding) : 'US-ASCII';
 	    $algorithm = $algorithm ? trim($algorithm) : 'REFERENCES';
 	    $criteria  = $criteria ? 'ALL '.trim($criteria) : 'ALL';

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list