summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-05-08 07:38:36 +0000
committeralecpl <alec@alec.pl>2008-05-08 07:38:36 +0000
commitf1b75374b2e087145cab5348331596ce3c16e8f6 (patch)
treead626fff66835d821f0fd2b789d268e89ee7d167 /program
parent1a659d789f8a30b0e8ee21f1c34abdfc1e1cd737 (diff)
- Optimized messages sorting on servers without sort capability (#1485049)
Diffstat (limited to 'program')
-rw-r--r--program/include/rcube_imap.php11
1 files changed, 3 insertions, 8 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index a01687de5..27169343d 100644
--- a/program/include/rcube_imap.php
+++ b/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;
}
/**