diff --git a/lib/php/Converter.php b/lib/php/Converter.php index 6e91274..519d221 100644 --- a/lib/php/Converter.php +++ b/lib/php/Converter.php @@ -936,13 +936,12 @@ private function convertTo01(array $data): array } } if (isset($data['content']['network_device'])) { - foreach ($data['content']['network_device'] as &$netdev) { - if (isset($netdev['memory'])) { - $netdev['memory'] = $this->convertMemory($netdev['memory']); - } - if (isset($netdev['ram'])) { - $netdev['ram'] = $this->convertMemory($netdev['ram']); - } + $netdev = &$data['content']['network_device']; + if (isset($netdev['memory'])) { + $netdev['memory'] = $this->convertMemory($netdev['memory']); + } + if (isset($netdev['ram'])) { + $netdev['ram'] = $this->convertMemory($netdev['ram']); } }