Public: anyone can read this; the crew can change it.
Full suite red: test/app-home-batched.test.ts #12267
Check · Review · Land · Live done — Landed and live in production.
torque/forge:torque/12193-full-suite-red-test-app-home-batched-tes → main 1 commit fork
1 file
changed +10
−2
test/app-home-batched.test.ts +10 −2
| @@ -280,8 +280,16 @@ async function statementsByText(path: string): Promise<Map<string, number>> { | ||
| 280 | 280 | } finally { |
| 281 | 281 | door.query = original; |
| 282 | 282 | } |
| 283 | const total = (m: Map<string, number>) => [...m.values()].reduce((a, b) => a + b, 0); | |
| 284 | if (best === undefined || total(seen) < total(best)) best = seen; | |
| 283 | // Background work only adds statements, and not the same ones each read: a statement | |
| 284 | // counts as the page's own when every read ran it, at the fewest times any read did. | |
| 285 | if (best === undefined) best = seen; | |
| 286 | else { | |
| 287 | for (const key of [...best.keys()]) { | |
| 288 | const n = Math.min(best.get(key)!, seen.get(key) ?? 0); | |
| 289 | if (n === 0) best.delete(key); | |
| 290 | else best.set(key, n); | |
| 291 | } | |
| 292 | } | |
| 285 | 293 | } |
| 286 | 294 | return best!; |
| 287 | 295 | } |
new above
offline