summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-06-04 10:06:10 +0000
committeralecpl <alec@alec.pl>2010-06-04 10:06:10 +0000
commitccf250ec1d0a979e878769cb87d939c970fc863a (patch)
tree621bc53af07aedce922bda6e20defe44fa89d857 /program/include
parent309f49f09bc8b663a3ddf834ca0e79f909a0928c (diff)
- performance improvement: we can skip THREAD when folder is empty
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_imap_generic.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index ab37902ae..411e1d396 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -1552,8 +1552,15 @@ class rcube_imap_generic
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';