timetable performance optimization

This commit is contained in:
2026-09-25 22:27:10 +02:00
parent ef7d17033d
commit ed8e52f475
13 changed files with 391 additions and 137 deletions
@@ -213,10 +213,12 @@ class TimetableAppointmentFactory {
return LessonColor.forStatus(status);
}
McSubject? _findSubject(String? subjectShort) {
if (subjectShort == null) return null;
return subjects.where((s) => s.shortName == subjectShort).firstOrNull;
}
late final Map<String, McSubject> _subjectsByShort = {
for (final s in subjects.reversed) s.shortName: s,
};
McSubject? _findSubject(String? subjectShort) =>
subjectShort == null ? null : _subjectsByShort[subjectShort];
String _subjectName(String? subjectShort, McTimetableEntry lesson) {
if (subjectShort != null) {