Skip to content

Commit c0ce7ea

Browse files
Micro optimization: Replace != with !==
1 parent aa068f9 commit c0ce7ea

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,16 @@ protected function _getWebsiteCurrencyRates()
9797
);
9898
foreach ($this->_storeManager->getWebsites() as $website) {
9999
/* @var $website \Magento\Store\Model\Website */
100-
if ($website->getBaseCurrencyCode() != $baseCurrency) {
100+
$websiteBaseCurrency = $website->getBaseCurrencyCode();
101+
if ($websiteBaseCurrency !== $baseCurrency) {
101102
$rate = $this->_currencyFactory->create()->load(
102103
$baseCurrency
103-
)->getRate(
104-
$website->getBaseCurrencyCode()
105-
);
104+
)->getRate($websiteBaseCurrency);
106105
if (!$rate) {
107106
$rate = 1;
108107
}
109108
$this->_rates[$website->getId()] = [
110-
'code' => $website->getBaseCurrencyCode(),
109+
'code' => $websiteBaseCurrency,
111110
'rate' => $rate,
112111
];
113112
} else {

0 commit comments

Comments
 (0)