Cleanup of isUnique

isUnique takes the count of the args multiple times.  Store the count in a variable to cut down on overhead.
This commit is contained in:
watermark 2014-11-11 16:13:16 -05:00
parent 2990c2143c
commit 8712dc01df

View file

@ -3315,9 +3315,10 @@ class Model extends Object implements CakeEventListener {
} }
if (!is_array($fields)) { if (!is_array($fields)) {
$fields = func_get_args(); $fields = func_get_args();
if (is_bool($fields[count($fields) - 1])) { $fieldCount = count($fields) - 1;
$or = $fields[count($fields) - 1]; if (is_bool($fields[$fieldCount])) {
unset($fields[count($fields) - 1]); $or = $fields[$fieldCount];
unset($fields[$fieldCount]);
} }
} }