Undo creating new sub arrays as this seems to be not required

This commit is contained in:
Dennis Eichhorn 2018-08-28 20:21:17 +02:00 committed by GitHub
parent a37dd5e792
commit 39b6f656f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,16 +96,8 @@ final class ArrayUtils
throw new \Exception(); throw new \Exception();
} }
$pathPartCount = \count($pathParts);
$c = 1;
foreach ($pathParts as $key) { foreach ($pathParts as $key) {
if (!isset($current[$key]) && $pathPartCount < $c) {
$current = [];
}
$current = &$current[$key]; $current = &$current[$key];
++$c;
} }
if ($overwrite) { if ($overwrite) {