Skip to content

Commit

Permalink
magento/magento2#: Remove a redundant getMappedNums from a loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Taranovskyi committed Sep 2, 2020
1 parent 1c87648 commit cd9e834
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function getEnumValueFromField(string $enumName, string $fieldValue) : st
$mappedValues = $this->enumDataMapper->getMappedEnums($enumName);

foreach ($enumObject->getValues() as $enumItem) {
if (isset($mappedValues[$enumItem->getName()]) && $mappedValues[$enumItem->getName()] == $fieldValue) {
if (isset($mappedValues[$enumItem->getName()]) && $mappedValues[$enumItem->getName()] === $fieldValue) {
return $enumItem->getValue();
}
}
Expand Down

0 comments on commit cd9e834

Please sign in to comment.