Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

save some memory usage (PHP < 5.4) in case of huge content and cut of…

…f the isset call
  • Loading branch information...
commit 6d3e0a25b29eb16f5cbeac30481cc1dc2410008f 1 parent 2170d87
Mark S. dereuromark authored
3  lib/Cake/Controller/Component/CookieComponent.php
View
@@ -291,8 +291,7 @@ public function check($key = null) {
if (empty($key)) {
return false;
}
- $result = $this->read($key);
- return isset($result);
+ return $this->read($key) !== null;
}
/**
3  lib/Cake/Core/Configure.php
View
@@ -180,8 +180,7 @@ public static function check($var = null) {
if (empty($var)) {
return false;
}
- $result = Hash::get(self::$_values, $var);
- return isset($result);
+ return Hash::get(self::$_values, $var) !== null;
}
/**
6 lib/Cake/Model/Datasource/CakeSession.php
View
@@ -218,8 +218,7 @@ public static function check($name = null) {
if (empty($name)) {
return false;
}
- $result = Hash::get($_SESSION, $name);
- return isset($result);
+ return Hash::get($_SESSION, $name) !== null;
}
/**
@@ -283,9 +282,8 @@ protected static function _overwrite(&$old, $new) {
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];
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.