From 85f4209074aab255dacd766109af5092017606ae Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 02 Oct 2015 04:56:35 -0400
Subject: [PATCH] Code improvements: CS fixes, improved internal cache cleanup on folder selection, removed redundant cache

---
 program/lib/Roundcube/rcube_imap.php |   15 +--------------
 1 files changed, 1 insertions(+), 14 deletions(-)

diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php
index d736235..dfcfb51 100644
--- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -62,7 +62,6 @@
     protected $sort_field = '';
     protected $sort_order = 'DESC';
     protected $struct_charset;
-    protected $uid_id_map = array();
     protected $msg_headers = array();
     protected $search_set;
     protected $search_string = '';
@@ -2682,7 +2681,6 @@
             // really deleted from the folder
             $this->expunge_message($uids, $folder, false);
             $this->clear_messagecount($folder);
-            unset($this->uid_id_map[$folder]);
 
             // unset threads internal cache
             unset($this->icache['threads']);
@@ -3963,8 +3961,6 @@
 
             return $res;
         }
-
-        return null;
     }
 
     /**
@@ -3985,7 +3981,6 @@
         }
 
         // @TODO: log error
-        return null;
     }
 
 
@@ -4254,19 +4249,11 @@
             $folder = $this->folder;
         }
 
-        if ($uid = array_search($id, (array)$this->uid_id_map[$folder])) {
-            return $uid;
-        }
-
         if (!$this->check_connection()) {
             return null;
         }
 
-        $uid = $this->conn->ID2UID($folder, $id);
-
-        $this->uid_id_map[$folder][$uid] = $id;
-
-        return $uid;
+        return $this->conn->ID2UID($folder, $id);
     }
 
     /**

--
Gitblit v1.9.1