- if (aBestPick) {
- /*
- * anItem has less unmet
- * dependancies than any
- * other item so far, so it
- * wins.
- */
- syslog(LOG_DEBUG, "Best pick so far, based on failed dependancies (%d->%d)",
- aMinFailedAntecedents, aFailedAntecedentsCount);
- } else if ((anAction == kActionStart) ?
- (aPriority >= aMaxPriority) :
- (aPriority <= aMaxPriority)) {
- /*
- * anItem has a best
- * priority, so it wins.
- */
- syslog(LOG_DEBUG, "Best pick so far, based on Priority (%d->%d)",
- aMaxPriority, aPriority);
- } else
- goto next_item; /* No soup for you! */
-
- /*
- * We have a winner! Update success
- * parameters to match anItem.
- */
- aMinFailedAntecedents = aFailedAntecedentsCount;
- aMaxPriority = aPriority;
- aNextItem = anItem;
- }