From 797d962e40587ee6b014e4380b30b406d69f37d2 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sun, 13 Oct 2019 19:09:55 -0400 Subject: [PATCH] [O] Optimize isGradingReady() with Array.every() --- src/components/app/app.ts | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/components/app/app.ts b/src/components/app/app.ts index d833c2e..142f40a 100644 --- a/src/components/app/app.ts +++ b/src/components/app/app.ts @@ -224,7 +224,7 @@ export default class App extends Vue } // Wait for done - pWaitFor(() => this.isGradingReady()).then(() => + pWaitFor(() => this.filteredCourses.every(c => c.grading != undefined)).then(() => { // When the assignments are ready // TODO: Display loading @@ -232,24 +232,6 @@ export default class App extends Vue }) } - /** - * Are grading algorithms ready or not. - * - * @returns boolean Ready or not - */ - private isGradingReady(): boolean - { - for (const course of this.filteredCourses) - { - if (course.grading == undefined) - { - return false; - } - } - - return true; - } - /** * This is called when a navigation tab is clicked *