Skip to content

Commit

Permalink
Small performance improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
canihavesomecoffee committed Feb 24, 2019
1 parent 32bb090 commit 5577837
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/MultiLanguageWrapper/ClassValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ public function merge(string $returnTypeClass, $existingInstance, $newInstance)
if (array_key_exists($returnTypeClass, $this->getRequiredFields()) && $newInstance !== null) {
foreach ($this->getRequiredFields()[$returnTypeClass] as $property) {
if (is_array($existingInstance)) {
for ($index = 0; $index < sizeof($existingInstance); $index++) {
$existingInstanceSize = sizeof($existingInstance);
for ($index = 0; $index < $existingInstanceSize; $index++) {
if ($existingInstance[$index]->{$property} === null) {
$existingInstance[$index]->{$property} = $newInstance[$index]->{$property};
}
Expand Down

0 comments on commit 5577837

Please sign in to comment.