Permalink
Browse files

Another micro-optimization, sorry

  • Loading branch information...
1 parent e7a7a17 commit 5674e9fd170bf1152acd903e692b1bea9a821daa @lorenzo lorenzo committed Apr 24, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/Cake/Cache/CacheEngine.php
@@ -44,11 +44,13 @@
* @return boolean True if the engine has been successfully initialized, false if not
*/
public function init($settings = array()) {
- $this->settings = array_merge(
- array('prefix' => 'cake_', 'duration' => 3600, 'probability' => 100, 'groups' => array()),
- $this->settings,
- $settings
+ $settings += $this->settings + array(
+ 'prefix' => 'cake_',
+ 'duration' => 3600,
+ 'probability' => 100,
+ 'groups' => array()
);
+ $this->settings = $settings;
if (!empty($this->settings['groups'])) {
sort($this->settings['groups']);
$this->_groupPrefix = str_repeat('%s_', count($this->settings['groups']));

0 comments on commit 5674e9f

Please sign in to comment.