diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-01-29 13:51:23 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-01-29 13:51:23 +0000 |
| commit | 747ee1dca3a858e99bebc3a5428ad22d1a4a940b (patch) | |
| tree | 4e8a00c0381f6f56a8adae6a47461e7e1185e4c7 /roundcubemail/program/steps/mail | |
| parent | 6f91d3323134319b7d53d3929cfa746930003632 (diff) | |
- small optimization
git-svn-id: https://svn.roundcube.net/trunk@3238 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail')
| -rw-r--r-- | roundcubemail/program/steps/mail/show.inc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/roundcubemail/program/steps/mail/show.inc b/roundcubemail/program/steps/mail/show.inc index 3998e6211..33e87d5bc 100644 --- a/roundcubemail/program/steps/mail/show.inc +++ b/roundcubemail/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) |
