Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Replaced simple and therefore pointless array_push function reference…
…s with the ordinary way of adding an array element. This will increase the performance and the code looks much cleaner this way IMHO
  • Loading branch information
and-ers committed Jan 2, 2013
1 parent 83abced commit c72c612
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Console/ConsoleOptionParser.php
Expand Up @@ -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);
Expand All @@ -636,7 +636,7 @@ protected function _parseArg($argument, $args) {
}

if ($this->_args[$next]->validChoice($argument)) {
array_push($args, $argument);
$args[] = $argument;
return $args;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Utility/String.php
Expand Up @@ -523,7 +523,7 @@ class_exists('Multibyte');
}
} else {
foreach ($droppedTags as $closingTag) {
array_push($openTags, $closingTag[1]);
$openTags[] = $closingTag[1];
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/View/ScaffoldView.php
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/View/View.php
Expand Up @@ -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;
}
Expand Down

0 comments on commit c72c612

Please sign in to comment.