Skip to content

Commit f877fff

Browse files
committed
Linting and formatting FE fix
1 parent 21a688b commit f877fff

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

ctu-timetable-generator/src/app/generator/_worker/processing.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,19 @@ function timeTableAddParallel(
4343
let success = false;
4444
for (const lle of singleDay) {
4545
if (calcTimeDiff(lle.value.start[0], lle.value.start[1], eventNew.end[0], eventNew.end[1]) >= 0) {
46-
if (lle.pre === singleDay.end() || (lle.pre !== singleDay.end() && calcTimeDiff(lle.pre.value.end[0], lle.pre.value.end[1], eventNew.start[0], eventNew.start[1]) <= 0)) {
46+
if (
47+
lle.pre === singleDay.end()
48+
|| (lle.pre !== singleDay.end() && calcTimeDiff(lle.pre.value.end[0], lle.pre.value.end[1], eventNew.start[0], eventNew.start[1]) <= 0)
49+
) {
4750
addedNodes[dayIdx].push(singleDay.insertBefore(eventNew, lle));
4851
success = true;
4952
break;
5053
}
5154
} else if (calcTimeDiff(lle.value.end[0], lle.value.end[1], eventNew.start[0], eventNew.start[1]) <= 0) {
52-
if (lle.next === singleDay.end() || (lle.next !== singleDay.end() && calcTimeDiff(lle.next.value.start[0], lle.next.value.start[1], eventNew.end[0], eventNew.end[1]) >= 0)) {
55+
if (
56+
lle.next === singleDay.end()
57+
|| (lle.next !== singleDay.end() && calcTimeDiff(lle.next.value.start[0], lle.next.value.start[1], eventNew.end[0], eventNew.end[1]) >= 0)
58+
) {
5359
addedNodes[dayIdx].push(singleDay.insertAfter(eventNew, lle));
5460
success = true;
5561
break;
@@ -94,7 +100,7 @@ function solve(
94100

95101
// Skip if the parallel has no events (https://github.com/antoninkriz/CTU-TimeTable-Generator/issues/3
96102
// Add parallel to the timetable, returned false means collision, skip this parallel
97-
const isCollision = parallel.timetable.length > 0 && !timeTableAddParallel(timetable, parallel, addedNodes)
103+
const isCollision = parallel.timetable.length > 0 && !timeTableAddParallel(timetable, parallel, addedNodes);
98104
if (isCollision) {
99105
progress.increment(branchWeights[depth + 1]);
100106
continue;

ctu-timetable-generator/src/app/generator/lib.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function mergeConflictingEventsInTimeTable(
5353
const newEventsThisDay: TimeTableEvent[] = [];
5454
const roomsSet = new Set<string>();
5555
for (const event of events) {
56-
const lastEventEnd = newEventsThisDay[newEventsThisDay.length - 1].end
56+
const lastEventEnd = newEventsThisDay[newEventsThisDay.length - 1].end;
5757
if (newEventsThisDay.length === 0 || calcTimeDiff(lastEventEnd[0], lastEventEnd[1], event.start[0], event.start[1]) < 0) {
5858
// No overlap with the last event
5959
newEventsThisDay.push(event);
@@ -107,7 +107,7 @@ const compareTimeTableEvents = (a: TimeTableEventOnLoad, b: TimeTableEventOnLoad
107107
if (startTimeDiff !== 0) return startTimeDiff;
108108

109109
// Finally, compare by the end time (earlier end comes first)
110-
return calcTimeDiff(a.end[0], a.end[1], b.end[0], b.end[1]);;
110+
return calcTimeDiff(a.end[0], a.end[1], b.end[0], b.end[1]);
111111
};
112112

113113
const processParallelByType = (parallels: ParallelOnLoad[], parallelType: ParallelType): Parallel[] =>

0 commit comments

Comments
 (0)