Skip to content

Commit

Permalink
Don't call functions that will return the same value in a loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Feb 14, 2014
1 parent 0853bbc commit 382f815
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions framework/ActiveSync/lib/Horde/ActiveSync/Folder/Imap.php
Expand Up @@ -100,11 +100,14 @@ class Horde_ActiveSync_Folder_Imap extends Horde_ActiveSync_Folder_Base implemen
*/
public function setChanges(array $messages, array $flags = array())
{
$uidnext = $this->uidnext();
$minuid = $this->minuid();
$modseq = $this->modseq();
foreach ($messages as $uid) {
if ($uid >= $this->uidnext()) {
if ($uid >= $uidnext) {
$this->_added[] = $uid;
} elseif ($uid >= $this->minuid()) {
if ($this->modseq() > 0) {
} elseif ($uid >= $minuid) {
if ($modseq > 0) {
$this->_changed[] = $uid;
} else {
if (empty($this->_messages[$uid])) {
Expand Down

0 comments on commit 382f815

Please sign in to comment.