You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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);
}
}
The text was updated successfully, but these errors were encountered:
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);
}
}
The text was updated successfully, but these errors were encountered: