MDL-36761 core_grade:shifted a call to count() out of a loop
This commit is contained in:
@@ -892,7 +892,9 @@ class grade_category extends grade_object {
|
||||
$droppedsomething = false;
|
||||
|
||||
$grade_keys = array_keys($grade_values);
|
||||
if (count($grade_keys) === 0) {
|
||||
$gradekeycount = count($grade_keys);
|
||||
|
||||
if ($gradekeycount === 0) {
|
||||
//We've dropped all grade items
|
||||
break;
|
||||
}
|
||||
@@ -916,7 +918,7 @@ class grade_category extends grade_object {
|
||||
}
|
||||
|
||||
$i = 1;
|
||||
while ($originalindex+$i < count($grade_keys)) {
|
||||
while ($originalindex + $i < $gradekeycount) {
|
||||
|
||||
$possibleitemid = $grade_keys[$originalindex+$i];
|
||||
$i++;
|
||||
|
||||
Reference in New Issue
Block a user