1
0
Fork 0

Remove a few hundred/thousand array_merge calls

pull/4229/head
Nils Adermann 2015-07-08 13:36:19 +02:00
parent dbdd4978a7
commit e88df7429f
1 changed files with 3 additions and 2 deletions

View File

@ -257,10 +257,11 @@ class VersionParser
foreach ($orConstraints as $constraints) {
$andConstraints = preg_split('{(?<!^|as|[=>< ,]) *(?<!-)[, ](?!-) *(?!,|as|$)}', $constraints);
if (count($andConstraints) > 1) {
$constraintObjects = array();
$constraintObjects = array(array());
foreach ($andConstraints as $constraint) {
$constraintObjects = array_merge($constraintObjects, $this->parseConstraint($constraint));
$constraintObjects[] = $this->parseConstraint($constraint);
}
$constraintObjects = call_user_func_array('array_merge', $constraintObjects);
} else {
$constraintObjects = $this->parseConstraint($andConstraints[0]);
}