mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
save some memory usage (PHP < 5.4) in case of huge content and cut off the isset call
This commit is contained in:
parent
2170d87488
commit
6d3e0a25b2
3 changed files with 4 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue