| ... | ... | @@ -448,14 +448,20 @@ fn queueJobsForDeps(f: *Fetch, hash: Manifest.MultiHashHexDigest) RunError!void |
| 448 | 448 | try f.job_queue.all_fetches.ensureUnusedCapacity(gpa, new_fetches.len); |
| 449 | 449 | try f.job_queue.table.ensureUnusedCapacity(gpa, @intCast(new_fetches.len + 1)); |
| 450 | 450 | |
| 451 | | // It is impossible for there to be a collision here. Consider all three cases: |
| 451 | // There are four cases here: |
| 452 | 452 | // * Correct hash is provided by manifest. |
| 453 | | // - Redundant jobs are skipped in the loop below. |
| 453 | // - Hash map already has the entry, no need to add it again. |
| 454 | 454 | // * Incorrect hash is provided by manifest. |
| 455 | 455 | // - Hash mismatch error emitted; `queueJobsForDeps` is not called. |
| 456 | 456 | // * Hash is not provided by manifest. |
| 457 | 457 | // - Hash missing error emitted; `queueJobsForDeps` is not called. |
| 458 | | f.job_queue.table.putAssumeCapacityNoClobber(hash, f); |
| 458 | // * path-based location is used without a hash. |
| 459 | // - We need to add `hash` to the table now. |
| 460 | switch (f.location) { |
| 461 | .remote => assert(f.job_queue.table.get(hash) == f), |
| 462 | .relative_path => f.job_queue.table.putAssumeCapacityNoClobber(hash, f), |
| 463 | .path_or_url => unreachable, |
| 464 | } |
| 459 | 465 | |
| 460 | 466 | for (deps) |dep| { |
| 461 | 467 | const new_fetch = &new_fetches[new_fetch_index]; |