microptimize options and default merge and other string key array merges

This commit is contained in:
euromark 2014-04-08 01:25:14 +02:00
parent 8d47ef43e5
commit 0ece694a75
35 changed files with 121 additions and 133 deletions

View file

@ -81,7 +81,7 @@ class PhpAcl extends Object implements AclInterface {
*/
public function initialize(Component $Component) {
if (!empty($Component->settings['adapter'])) {
$this->options = array_merge($this->options, $Component->settings['adapter']);
$this->options = $Component->settings['adapter'] + $this->options;
}
App::uses('PhpReader', 'Configure');
@ -546,7 +546,7 @@ class PhpAro {
* @return void
*/
public function addAlias(array $alias) {
$this->aliases = array_merge($this->aliases, $alias);
$this->aliases = $alias + $this->aliases;
}
/**

View file

@ -603,7 +603,7 @@ class RequestHandlerComponent extends Component {
if (Configure::read('App.encoding') !== null) {
$defaults['charset'] = Configure::read('App.encoding');
}
$options = array_merge($defaults, $options);
$options += $defaults;
if ($type === 'ajax') {
$controller->layout = $this->ajaxLayout;