From 4aecda3a93052ed225e649d6c4abd6b15f53edfd Mon Sep 17 00:00:00 2001 From: James Michael DuPont Date: Thu, 27 Sep 2012 19:49:42 +0200 Subject: [PATCH] refactor src/Symfony/Component/Translation/Loader/MoFileLoader.php --- .../Translation/Loader/MoFileLoader.php | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/Symfony/Component/Translation/Loader/MoFileLoader.php b/src/Symfony/Component/Translation/Loader/MoFileLoader.php index c5daa3561eb1..649a88582662 100644 --- a/src/Symfony/Component/Translation/Loader/MoFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/MoFileLoader.php @@ -90,18 +90,13 @@ private function parse($resource) throw new \InvalidArgumentException("MO stream content has an invalid format."); } - $header = array( - 'formatRevision' => null, - 'count' => null, - 'offsetId' => null, - 'offsetTranslated' => null, - 'sizeHashes' => null, - 'offsetHashes' => null, - ); - foreach ($header as &$value) { - $value = $this->readLong($stream, $isBigEndian); - } - extract($header); + $formatRevision = $this->readLong($stream, $isBigEndian); + $count = $this->readLong($stream, $isBigEndian); + $offsetId = $this->readLong($stream, $isBigEndian); + $offsetTranslated = $this->readLong($stream, $isBigEndian); + $sizeHashes = $this->readLong($stream, $isBigEndian); + $offsetHashes = $this->readLong($stream, $isBigEndian); + $messages = array(); for ($i = 0; $i < $count; $i++) {