diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2021-04-13 09:52:45 -0500 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2021-04-13 09:52:45 -0500 |
| commit | e14581fb25febd28b8e55ca8e2b24ebafa3abbc2 (patch) | |
| tree | c4a895432fbf193d5d753c3bb6f22318f45fdd15 | |
| parent | b595ffa5efaa76d97fd6d6b79c24af46755cffd4 (diff) | |
Optimize selectedPeerTeacherAssignments sort condition
| -rw-r--r-- | src/components/EditorLists.vue | 18 |
1 files changed, 1 insertions, 17 deletions
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() { |
