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)) {
|
if (empty($key)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$result = $this->read($key);
|
return $this->read($key) !== null;
|
||||||
return isset($result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -180,8 +180,7 @@ class Configure {
|
||||||
if (empty($var)) {
|
if (empty($var)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$result = Hash::get(self::$_values, $var);
|
return Hash::get(self::$_values, $var) !== null;
|
||||||
return isset($result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -218,8 +218,7 @@ class CakeSession {
|
||||||
if (empty($name)) {
|
if (empty($name)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$result = Hash::get($_SESSION, $name);
|
return Hash::get($_SESSION, $name) !== null;
|
||||||
return isset($result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -283,9 +282,8 @@ class CakeSession {
|
||||||
protected static function _error($errorNumber) {
|
protected static function _error($errorNumber) {
|
||||||
if (!is_array(self::$error) || !array_key_exists($errorNumber, self::$error)) {
|
if (!is_array(self::$error) || !array_key_exists($errorNumber, self::$error)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
|
||||||
return self::$error[$errorNumber];
|
|
||||||
}
|
}
|
||||||
|
return self::$error[$errorNumber];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue