detect "not scheduled" faster (#3200)

* fatal if not found

* handle not-scheduled

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
Matthew Kennedy 2021-08-27 01:46:01 -07:00 committed by GitHub
parent 9d437474b2
commit ad205cb15e
1 changed files with 7 additions and 1 deletions

View File

@ -77,6 +77,11 @@ void EventQueue::remove(scheduling_s* scheduling) {
assertListIsSorted();
#endif /* EFI_UNIT_TEST */
// Special case: event isn't scheduled, so don't cancel it
if (!scheduling->action) {
return;
}
// Special case: empty list, nothing to do
if (!head) {
return;
@ -97,8 +102,9 @@ void EventQueue::remove(scheduling_s* scheduling) {
current = current->nextScheduling_s;
}
// Walked off the end, not present, nothing more to do
// Walked off the end, this is an error since this *should* have been scheduled
if (!current) {
firmwareError(OBD_PCM_Processor_Fault, "EventQueue::remove didn't find element");
return;
}