Unified · Split
| @@ -159,7 +159,7 @@ pub fn update( · 158 unmodified lines | ||
| 159 | 159 | compute_stats: bool, |
| 160 | 160 | } |
| 161 | 161 | let (tx_tree_ids, stat_threads) = { |
| 162 | − let (tx, rx) = crossbeam_channel::unbounded::<(SequenceId, Vec<Task>)>(); | |
| 162 | + let (tx, rx) = crossbeam_channel::bounded::<(SequenceId, Vec<Task>)>(threads); | |
| 163 | 163 | let stat_workers = (0..threads) |
| 164 | 164 | .map(|_| { |
| 165 | 165 | scope.spawn({ |
| @@ -324,12 +324,6 @@ pub fn update( · 158 unmodified lines | ||
| 324 | 324 | } |
| 325 | 325 | }; |
| 326 | 326 | if let Some((first_parent, commit)) = res { |
| 327 | − if chunk.len() == CHUNK_SIZE { | |
| 328 | − tx_tree_ids | |
| 329 | − .send((chunk_id, std::mem::replace(&mut chunk, Vec::with_capacity(CHUNK_SIZE)))) | |
| 330 | − .ok(); | |
| 331 | − chunk_id += 1; | |
| 332 | − } | |
| 333 | 327 | chunk.push(Task { |
| 334 | 328 | parent_commit: first_parent, |
| 335 | 329 | commit, |
| @@ -342,6 +336,12 @@ pub fn update( · 6 unmodified lines | ||
| 342 | 336 | compute_stats: false, |
| 343 | 337 | }); |
| 344 | 338 | } |
| 339 | + if chunk.len() == CHUNK_SIZE { | |
| 340 | + tx_tree_ids | |
| 341 | + .send((chunk_id, std::mem::replace(&mut chunk, Vec::with_capacity(CHUNK_SIZE)))) | |
| 342 | + .ok(); | |
| 343 | + chunk_id += 1; | |
| 344 | + } | |
| 345 | 345 | } |
| 346 | 346 | Ok(gix::objs::CommitRefIter::from_bytes(obj.data)) |
| 347 | 347 | }), |