mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
small return home early refactorings for the set class
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7655 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
cc425a5e0a
commit
5aade5b581
1 changed files with 7 additions and 7 deletions
|
@ -703,13 +703,13 @@ class Set extends Object {
|
|||
}
|
||||
if ($i === count($path) - 1) {
|
||||
return (is_array($data) && array_key_exists($key, $data));
|
||||
} else {
|
||||
}
|
||||
|
||||
if (!is_array($data) || !array_key_exists($key, $data)) {
|
||||
return false;
|
||||
}
|
||||
$data =& $data[$key];
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
|
@ -723,7 +723,8 @@ class Set extends Object {
|
|||
function diff($val1, $val2 = null) {
|
||||
if (empty($val1)) {
|
||||
return (array)$val2;
|
||||
} elseif (empty($val2)) {
|
||||
}
|
||||
if (empty($val2)) {
|
||||
return (array)$val1;
|
||||
}
|
||||
$out = array();
|
||||
|
@ -766,7 +767,6 @@ class Set extends Object {
|
|||
* @access public
|
||||
*/
|
||||
function contains($val1, $val2 = null) {
|
||||
|
||||
if (empty($val1) || empty($val2)) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue