resourceAt method

CapturedResource? resourceAt(
  1. String key,
  2. int passIndex
)

The latest write of key at or before passIndex, or null.

Implementation

CapturedResource? resourceAt(String key, int passIndex) {
  CapturedResource? best;
  for (final resource in resources) {
    if (resource.key != key) continue;
    if (resource.passIndex > passIndex) continue;
    if (best == null || resource.passIndex > best.passIndex) best = resource;
  }
  return best;
}