mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
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:
parent
2990c2143c
commit
8712dc01df
1 changed files with 4 additions and 3 deletions
|
@ -3315,9 +3315,10 @@ class Model extends Object implements CakeEventListener {
|
|||
}
|
||||
if (!is_array($fields)) {
|
||||
$fields = func_get_args();
|
||||
if (is_bool($fields[count($fields) - 1])) {
|
||||
$or = $fields[count($fields) - 1];
|
||||
unset($fields[count($fields) - 1]);
|
||||
$fieldCount = count($fields) - 1;
|
||||
if (is_bool($fields[$fieldCount])) {
|
||||
$or = $fields[$fieldCount];
|
||||
unset($fields[$fieldCount]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue