From c72c612625588a17a0d4371688f4845699a683cd Mon Sep 17 00:00:00 2001 From: and-ers Date: Wed, 2 Jan 2013 23:47:27 +0100 Subject: [PATCH] Replaced simple and therefore pointless array_push function references with the ordinary way of adding an array element. This will increase the performance and the code looks much cleaner this way IMHO --- lib/Cake/Console/ConsoleOptionParser.php | 4 ++-- lib/Cake/Utility/String.php | 2 +- lib/Cake/View/ScaffoldView.php | 2 +- lib/Cake/View/View.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Cake/Console/ConsoleOptionParser.php b/lib/Cake/Console/ConsoleOptionParser.php index 97726f0beaf..8d3cdeeed76 100644 --- a/lib/Cake/Console/ConsoleOptionParser.php +++ b/lib/Cake/Console/ConsoleOptionParser.php @@ -627,7 +627,7 @@ protected function _optionExists($name) { */ protected function _parseArg($argument, $args) { if (empty($this->_args)) { - array_push($args, $argument); + $args[] = $argument; return $args; } $next = count($args); @@ -636,7 +636,7 @@ protected function _parseArg($argument, $args) { } if ($this->_args[$next]->validChoice($argument)) { - array_push($args, $argument); + $args[] = $argument; return $args; } } diff --git a/lib/Cake/Utility/String.php b/lib/Cake/Utility/String.php index 01f9acbbbd1..65969b69cc4 100644 --- a/lib/Cake/Utility/String.php +++ b/lib/Cake/Utility/String.php @@ -523,7 +523,7 @@ class_exists('Multibyte'); } } else { foreach ($droppedTags as $closingTag) { - array_push($openTags, $closingTag[1]); + $openTags[] = $closingTag[1]; } } } diff --git a/lib/Cake/View/ScaffoldView.php b/lib/Cake/View/ScaffoldView.php index 5cb9fb67767..04674a3389d 100644 --- a/lib/Cake/View/ScaffoldView.php +++ b/lib/Cake/View/ScaffoldView.php @@ -69,7 +69,7 @@ protected function _getViewFileName($name = null) { $paths = $this->_paths($this->plugin); $exts = array($this->ext); if ($this->ext !== '.ctp') { - array_push($exts, '.ctp'); + $exts[] = '.ctp'; } foreach ($exts as $ext) { foreach ($paths as $path) { diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php index 4082125844b..475f02bb37e 100644 --- a/lib/Cake/View/View.php +++ b/lib/Cake/View/View.php @@ -1058,7 +1058,7 @@ protected function _getLayoutFileName($name = null) { protected function _getExtensions() { $exts = array($this->ext); if ($this->ext !== '.ctp') { - array_push($exts, '.ctp'); + $exts[] = '.ctp'; } return $exts; }