Skip to content

Commit eb81164

Browse files
committed
Swatches eliminate objects instantiation
1 parent a25c107 commit eb81164

File tree

1 file changed

+4
-4
lines changed
  • app/code/Magento/Swatches/Helper

1 file changed

+4
-4
lines changed

app/code/Magento/Swatches/Helper/Data.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,13 +471,13 @@ public function getSwatchesByOptionsId(array $optionIds)
471471
$swatches = [];
472472
$fallbackValues = [];
473473
$currentStoreId = $this->storeManager->getStore()->getId();
474-
foreach ($swatchCollection as $item) {
474+
foreach ($swatchCollection->getData() as $item) {
475475
if ($item['type'] != Swatch::SWATCH_TYPE_TEXTUAL) {
476-
$swatches[$item['option_id']] = $item->getData();
476+
$swatches[$item['option_id']] = $item;
477477
} elseif ($item['store_id'] == $currentStoreId && $item['value'] != '') {
478-
$fallbackValues[$item['option_id']][$currentStoreId] = $item->getData();
478+
$fallbackValues[$item['option_id']][$currentStoreId] = $item;
479479
} elseif ($item['store_id'] == self::DEFAULT_STORE_ID) {
480-
$fallbackValues[$item['option_id']][self::DEFAULT_STORE_ID] = $item->getData();
480+
$fallbackValues[$item['option_id']][self::DEFAULT_STORE_ID] = $item;
481481
}
482482
}
483483

0 commit comments

Comments
 (0)