[O] Optimize isAssignmentsReady()

This commit is contained in:
Hykilpikonna
2019-10-13 19:11:38 -04:00
parent 797d962e40
commit a537ced0d7
+1 -16
View File
@@ -164,7 +164,7 @@ export default class App extends Vue
});
// Wait for assignments to be ready.
pWaitFor(() => this.isAssignmentsReady()).then(() =>
pWaitFor(() => this.courses.every(c => c.assignments != null)).then(() =>
{
// Filter courses
this.filteredCourses = CourseUtils.getGradedCourses(this.courses);
@@ -174,21 +174,6 @@ export default class App extends Vue
});
}
/**
* Are assignments ready or not
*
* @returns boolean Ready or not
*/
private isAssignmentsReady(): boolean
{
for (const course of this.courses)
{
if (course.assignments == null) return false;
}
return true;
}
/**
* Check the courses' grading algorithms. (Total-mean or percent-type)
*/