Changeset 309f49f in github


Ignore:
Timestamp:
Jun 4, 2010 5:58:37 AM (3 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
ccf250e
Parents:
ffd3e29
Message:
  • performance improvement: skip SEARCH command when mailbox is empty and SEARCH is called just after SELECT
Location:
program/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • program/include/rcube_imap.php

    rffd3e29 r309f49f  
    477477            // get message count using SEARCH 
    478478            // not very performant but more precise (using UNDELETED) 
    479             // disable THREADS for this request 
    480             $threads = $this->threading; 
    481             $this->threading = false; 
    482             $index = $this->_search_index($mailbox, $search_str); 
    483             $this->threading = $threads; 
     479            $index = $this->conn->search($mailbox, $search_str); 
    484480 
    485481            $count = is_array($index) ? count($index) : 0; 
  • program/include/rcube_imap_generic.php

    rffd3e29 r309f49f  
    15851585    function search($folder, $criteria, $return_uid=false) 
    15861586    { 
     1587        $old_sel = $this->selected; 
     1588 
    15871589            if (!$this->select($folder)) { 
    15881590                return false; 
     1591            } 
     1592 
     1593        // return empty result when folder is empty and we're just after SELECT 
     1594        if ($old_sel != $folder && !$this->exists) { 
     1595            return array(); 
    15891596            } 
    15901597 
Note: See TracChangeset for help on using the changeset viewer.