alecpl
2010-10-29 01bdfd327c13faecb60ad7aa328557c3f5db3a9b
- Improve performance of clear_mailbox() when skip_deleted=true


1 files modified
8 ■■■■■ changed files
program/include/rcube_imap.php 8 ●●●●● patch | view | raw | blame | history
program/include/rcube_imap.php
@@ -2620,13 +2620,11 @@
    function clear_mailbox($mbox_name=NULL)
    {
        $mailbox = !empty($mbox_name) ? $this->mod_mailbox($mbox_name) : $this->mailbox;
        $msg_count = $this->_messagecount($mailbox, 'ALL');
        if (!$msg_count) {
            return 0;
        // SELECT will set messages count for clearFolder()
        if ($this->conn->select($mailbox)) {
            $cleared = $this->conn->clearFolder($mailbox);
        }
        $cleared = $this->conn->clearFolder($mailbox);
        // make sure the message count cache is cleared as well
        if ($cleared) {