From e14581fb25febd28b8e55ca8e2b24ebafa3abbc2 Mon Sep 17 00:00:00 2001
From: Furkan Sahin <furkan-dev@proton.me>
Date: Tue, 13 Apr 2021 09:52:45 -0500
Subject: Optimize selectedPeerTeacherAssignments sort condition

---
 src/components/EditorLists.vue | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

(limited to 'src/components/EditorLists.vue')

diff --git a/src/components/EditorLists.vue b/src/components/EditorLists.vue
index 2d72b1e..ae0aa22 100644
--- a/src/components/EditorLists.vue
+++ b/src/components/EditorLists.vue
@@ -53,23 +53,7 @@ export default defineComponent({
         .flatMap((id) => {
           const lab = this.$store.state.labs.get(id);
           return (lab === undefined) ? [] : [lab];
-        }).sort((a, b) => {
-          if (a.course < b.course) {
-            return -1;
-          }
-          if (b.course < a.course) {
-            return 1;
-          }
-
-          if (a.section < b.section) {
-            return -1;
-          }
-          if (b.section < a.section) {
-            return 1;
-          }
-
-          return 0;
-        });
+        }).sort((a, b) => a.course - b.course || a.section - b.section);
     },
   },
   data() {
-- 
cgit v1.2.3

