MDL-36761 core_grade:shifted a call to count() out of a loop

This commit is contained in:
Andrew Davis
2012-11-30 11:10:07 +08:00
parent e4592b226d
commit 26bc714f1f
+4 -2
View File
@@ -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++;