summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-01-29 13:51:23 +0000
committeralecpl <alec@alec.pl>2010-01-29 13:51:23 +0000
commite7dde1f0860e800be5f1e1e23fb66867a96e1f08 (patch)
treee3b4b214f94928d9d479f199da38254f25ab2cc2 /program/steps
parent2b35c5d8f6526c86d356913f151af7e6df3c2976 (diff)
- small optimization
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/mail/show.inc9
1 files changed, 5 insertions, 4 deletions
diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index 3998e6211..33e87d5bc 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -123,10 +123,11 @@ if ($_GET['_uid']) {
$MESSAGE->index = array_search($IMAP->get_id($MESSAGE->uid), $a_msg_index);
- $prev = isset($a_msg_index[$MESSAGE->index-1]) ? $IMAP->get_uid($a_msg_index[$MESSAGE->index-1]) : -1 ;
- $first = count($a_msg_index)>0 ? $IMAP->get_uid($a_msg_index[0]) : -1;
- $next = isset($a_msg_index[$MESSAGE->index+1]) ? $IMAP->get_uid($a_msg_index[$MESSAGE->index+1]) : -1 ;
- $last = count($a_msg_index)>0 ? $IMAP->get_uid($a_msg_index[count($a_msg_index)-1]) : -1;
+ $count = count($a_msg_index);
+ $prev = isset($a_msg_index[$MESSAGE->index-1]) ? $IMAP->get_uid($a_msg_index[$MESSAGE->index-1]) : -1;
+ $first = $count > 1 ? $IMAP->get_uid($a_msg_index[0]) : -1;
+ $next = isset($a_msg_index[$MESSAGE->index+1]) ? $IMAP->get_uid($a_msg_index[$MESSAGE->index+1]) : -1;
+ $last = $count > 1 ? $IMAP->get_uid($a_msg_index[$count-1]) : -1;
}
if ($prev > 0)