summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include/rcube_imap.php
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-05-08 07:38:36 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-05-08 07:38:36 +0000
commitac10fb742976230fc1e304cdcd1b40cd698d4bc5 (patch)
tree3c8be5607588dff3482ebe5e242304833acf6656 /roundcubemail/program/include/rcube_imap.php
parent8990d0ed8ab741d173ac50347517e8aa99707d6c (diff)
- Optimized messages sorting on servers without sort capability (#1485049)
git-svn-id: https://svn.roundcube.net/trunk@1363 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_imap.php')
-rw-r--r--roundcubemail/program/include/rcube_imap.php11
1 files changed, 3 insertions, 8 deletions
diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php
index a01687de5..27169343d 100644
--- a/roundcubemail/program/include/rcube_imap.php
+++ b/roundcubemail/program/include/rcube_imap.php
@@ -602,7 +602,6 @@ class rcube_imap
}
-
// return empty array if no messages found
if (!is_array($a_msg_headers) || empty($a_msg_headers)) {
return array();
@@ -2837,13 +2836,9 @@ class rcube_header_sorter
*/
function position_of($seqnum)
{
- $c = count($this->sequence_numbers);
- for ($pos = 0; $pos <= $c; $pos++)
- {
- if ($this->sequence_numbers[$pos] == $seqnum)
- return $pos;
- }
- return -1;
+ $pos = array_search($seqnum, $this->sequence_numbers);
+ if ($pos === false) return -1;
+ return $pos;
}
/**