Browse Source

Make merging config a teeny bit faster.

* Don't assign variables in a conditional.
* Calling Hash::get() directly saves 1 function call per merged key.
mark_story 12 years ago
parent
commit
b359b24082
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/Core/Configure.php

+ 3 - 2
src/Core/Configure.php

@@ -254,8 +254,9 @@ class Configure {
 		if ($merge) {
 			$keys = array_keys($values);
 			foreach ($keys as $key) {
-				if (($c = static::read($key)) && is_array($values[$key]) && is_array($c)) {
-					$values[$key] = Hash::merge($c, $values[$key]);
+				$current = Hash::get(static::$_values, $key);
+				if ($current && is_array($values[$key]) && is_array($current)) {
+					$values[$key] = Hash::merge($current, $values[$key]);
 				}
 			}
 		}