##// END OF EJS Templates
rust-status: wrap `stat_dmap_entries` to ease profiling...
Raphaël Gomès -
r45025:b8ba46c9 default
parent child Browse files
Show More
@@ -508,6 +508,21 b' fn stat_dmap_entries('
508 508 })
509 509 }
510 510
511 /// This takes a mutable reference to the results to account for the `extend`
512 /// in timings
513 fn extend_from_dmap<'a>(
514 dmap: &'a DirstateMap,
515 root_dir: impl AsRef<Path> + Sync + Send,
516 options: StatusOptions,
517 results: &mut Vec<(Cow<'a, HgPath>, Dispatch)>,
518 ) {
519 results.par_extend(
520 stat_dmap_entries(dmap, root_dir, options)
521 .flatten()
522 .map(|(filename, dispatch)| (Cow::Borrowed(filename), dispatch)),
523 );
524 }
525
511 526 pub struct DirstateStatus<'a> {
512 527 pub modified: Vec<Cow<'a, HgPath>>,
513 528 pub added: Vec<Cow<'a, HgPath>>,
@@ -766,10 +781,7 b" pub fn status<'a: 'c, 'b: 'c, 'c>("
766 781 } else {
767 782 // We may not have walked the full directory tree above, so stat
768 783 // and check everything we missed.
769 let stat_results = stat_dmap_entries(&dmap, root_dir, options);
770 results.par_extend(stat_results.flatten().map(
771 |(filename, dispatch)| (Cow::Borrowed(filename), dispatch),
772 ));
784 extend_from_dmap(&dmap, root_dir, options, &mut results);
773 785 }
774 786 }
775 787
General Comments 0
You need to be logged in to leave comments. Login now