From a537ced0d7d04e898b87cb169788104afe8934cf Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sun, 13 Oct 2019 19:11:38 -0400 Subject: [PATCH] [O] Optimize isAssignmentsReady() --- src/components/app/app.ts | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/components/app/app.ts b/src/components/app/app.ts index 142f40a..a141a3a 100644 --- a/src/components/app/app.ts +++ b/src/components/app/app.ts @@ -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) */