Skip to content

Commit 96e8e90

Browse files
authored
Removed redundant if statement (#1291)
1 parent 545c20c commit 96e8e90

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -596,14 +596,10 @@ public function addIdFilter($productId, $exclude = false)
596596
return $this;
597597
}
598598
if (is_array($productId)) {
599-
if (!empty($productId)) {
600-
if ($exclude) {
601-
$condition = array('nin' => $productId);
602-
} else {
603-
$condition = array('in' => $productId);
604-
}
599+
if ($exclude) {
600+
$condition = array('nin' => $productId);
605601
} else {
606-
$condition = '';
602+
$condition = array('in' => $productId);
607603
}
608604
} else {
609605
if ($exclude) {
@@ -613,6 +609,7 @@ public function addIdFilter($productId, $exclude = false)
613609
}
614610
}
615611
$this->addFieldToFilter('entity_id', $condition);
612+
616613
return $this;
617614
}
618615

0 commit comments

Comments
 (0)