Merge pull request #3259 from dereuromark/2.5-array-merge

microptimize options and default merge and other string key array merges
This commit is contained in:
Mark Story 2014-04-07 21:44:38 -04:00
commit caf0217fe0
38 changed files with 127 additions and 139 deletions

View file

@ -480,10 +480,10 @@ class Router {
}
if ($named === true || $named === false) {
$options = array_merge(array('default' => $named, 'reset' => true, 'greedy' => $named), $options);
$options += array('default' => $named, 'reset' => true, 'greedy' => $named);
$named = array();
} else {
$options = array_merge(array('default' => false, 'reset' => false, 'greedy' => true), $options);
$options += array('default' => false, 'reset' => false, 'greedy' => true);
}
if ($options['reset'] || self::$_namedConfig['rules'] === false) {
@ -532,11 +532,11 @@ class Router {
*/
public static function mapResources($controller, $options = array()) {
$hasPrefix = isset($options['prefix']);
$options = array_merge(array(
$options += array(
'connectOptions' => array(),
'prefix' => '/',
'id' => self::ID . '|' . self::UUID
), $options);
);
$prefix = $options['prefix'];
$connectOptions = $options['connectOptions'];