Skip to content

Commit

Permalink
optimize?
Browse files Browse the repository at this point in the history
  • Loading branch information
blumewas committed Jun 19, 2024
1 parent 711067e commit e0145b4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ protected function getArrayDiffDotted(array $array1, array $array2, string $file
$array1 = Arr::dot($array1, $file);
$array2 = Arr::dot($array2, $file);

return array_diff_key($array1, $array2);
return array_diff_key(
$array1 + $array2, // merge the arrays to get all keys
array_intersect_key($array1, $array2) // get the keys that are in both arrays
);
}

/**
Expand Down

0 comments on commit e0145b4

Please sign in to comment.