| 1 | extension RunTotals { | |
| 2 | /// The run to compare a new report with, chosen from the runs published so far | |
| 3 | /// (DESIGN.md D6, D9): the newest by `date` among those that have coverage (D8). | |
| 4 | /// Nil when there is none, so the report is built without deltas. | |
| 5 | 4 | public static func baseline(among publishedRuns: [RunTotals]) -> RunTotals? { |
| 6 | 8 | publishedRuns.filter { $0.unavailable == nil }.max { $0.date < $1.date } |
| 7 | 4 | } |
| 8 | } |