timetable performance optimization
This commit is contained in:
1 parent
ef7d17033d
commit
ed8e52f475
13 files changed
+391
-137
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user