Merge pull request #1055 from and-ers/master

Optimize and switch array_push() for [] =
This commit is contained in:
Mark Story 2013-01-02 17:41:35 -08:00
commit a949988208
4 changed files with 5 additions and 5 deletions

View file

@ -627,7 +627,7 @@ class ConsoleOptionParser {
*/
protected function _parseArg($argument, $args) {
if (empty($this->_args)) {
array_push($args, $argument);
$args[] = $argument;
return $args;
}
$next = count($args);
@ -636,7 +636,7 @@ class ConsoleOptionParser {
}
if ($this->_args[$next]->validChoice($argument)) {
array_push($args, $argument);
$args[] = $argument;
return $args;
}
}

View file

@ -523,7 +523,7 @@ class String {
}
} else {
foreach ($droppedTags as $closingTag) {
array_push($openTags, $closingTag[1]);
$openTags[] = $closingTag[1];
}
}
}

View file

@ -69,7 +69,7 @@ class ScaffoldView extends ThemeView {
$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) {

View file

@ -1058,7 +1058,7 @@ class View extends Object {
protected function _getExtensions() {
$exts = array($this->ext);
if ($this->ext !== '.ctp') {
array_push($exts, '.ctp');
$exts[] = '.ctp';
}
return $exts;
}