Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/public/product/IdentifierRequest.php #54

Open
Eayshwary opened this issue Feb 2, 2019 · 0 comments
Open

src/public/product/IdentifierRequest.php #54

Eayshwary opened this issue Feb 2, 2019 · 0 comments

Comments

@Eayshwary
Copy link

when inserting identifiers into $this->_valueList : in function

public function addValue($value)
{
array_push($this->_valueList, $value);
}

directly pushing the value of identifier and if the values are already present in the array it makes
execution time much more since it starts fetching same product number of times,

there can be small enhancement to reduce such complexities like below :
we can first check wheather or not values already present in an array before pushing them.

public function addValue($value)
{
if (!in_array($value, $this->_valueList)) {
array_push($this->_valueList, $value);
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant