save some memory usage (PHP < 5.4) in case of huge content and cut off the isset call

This commit is contained in:
euromark 2012-09-15 02:33:05 +02:00
parent 2170d87488
commit 6d3e0a25b2
3 changed files with 4 additions and 8 deletions

View file

@ -291,8 +291,7 @@ class CookieComponent extends Component {
if (empty($key)) {
return false;
}
$result = $this->read($key);
return isset($result);
return $this->read($key) !== null;
}
/**

View file

@ -180,8 +180,7 @@ class Configure {
if (empty($var)) {
return false;
}
$result = Hash::get(self::$_values, $var);
return isset($result);
return Hash::get(self::$_values, $var) !== null;
}
/**

View file

@ -218,8 +218,7 @@ class CakeSession {
if (empty($name)) {
return false;
}
$result = Hash::get($_SESSION, $name);
return isset($result);
return Hash::get($_SESSION, $name) !== null;
}
/**
@ -283,9 +282,8 @@ class CakeSession {
protected static function _error($errorNumber) {
if (!is_array(self::$error) || !array_key_exists($errorNumber, self::$error)) {
return false;
} else {
return self::$error[$errorNumber];
}
return self::$error[$errorNumber];
}
/**