timetable performance optimization
This commit is contained in:
@@ -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