@@ -7,7 +7,7 @@ use crate::lib::environment::Environment;
7
7
use crate :: lib:: error:: { BuildError , DfxError , DfxResult } ;
8
8
use crate :: lib:: metadata:: dfx:: DfxMetadata ;
9
9
use crate :: lib:: metadata:: names:: { CANDID_ARGS , CANDID_SERVICE , DFX } ;
10
- use crate :: lib:: graph:: traverse_filtered:: { self , DfsFiltered } ;
10
+ use crate :: lib:: graph:: traverse_filtered:: DfsFiltered ;
11
11
use crate :: lib:: wasm:: file:: { compress_bytes, read_wasm_module} ;
12
12
use crate :: util:: assets;
13
13
use anyhow:: { anyhow, bail, Context } ;
@@ -582,14 +582,15 @@ impl CanisterPool {
582
582
let source_graph = & self . imports . borrow ( ) . graph ;
583
583
let source_ids = & self . imports . borrow ( ) . nodes ;
584
584
let start: Vec < _ > =
585
- real_canisters_to_build. iter ( ) . map ( |name| & MotokoImport :: Canister ( name. clone ( ) ) ) . collect ( ) ; // `clone` is inefficient.
586
- let start = start. into_iter ( ) . map ( |node| * source_ids. get ( node) . unwrap ( ) ) . collect ( ) ;
585
+ real_canisters_to_build. iter ( ) . map ( |name| MotokoImport :: Canister ( name. clone ( ) ) ) . collect ( ) ; // `clone` is inefficient.
586
+ let start = start. into_iter ( ) . map ( |node| * source_ids. get ( & node) . unwrap ( ) ) . collect ( ) ;
587
587
// // Transform the graph of file dependencies to graph of canister dependencies.
588
588
// // For this do DFS for each of `real_canisters_to_build`.
589
589
let mut dest_graph: DiGraph < CanisterId , ( ) > = DiGraph :: new ( ) ;
590
590
let mut dest_id_set = HashMap :: new ( ) ;
591
591
let dfs = Dfs :: from_parts ( start, HashSet :: new ( ) ) ; // TODO: Use `FixedBitSet` instead of `HashMap`?
592
- let filtered_dfs = DfsFiltered :: new ( dfs) ;
592
+ let mut filtered_dfs = DfsFiltered :: new ( dfs) ;
593
+ // let dest_id_set = &mut dest_id_set;
593
594
filtered_dfs. traverse (
594
595
source_graph,
595
596
|& s| {
@@ -600,10 +601,10 @@ impl CanisterPool {
600
601
false
601
602
}
602
603
} ,
603
- |parent_id, child_id| {
604
- let parent_id = * dest_id_set. entry ( * parent_id) . or_insert_with ( || parent_id) ;
605
- let child_id = * dest_id_set. entry ( * child_id) . or_insert_with ( || child_id) ;
606
- dest_graph. add_edge ( * parent_id, * child_id, ( ) ) ;
604
+ |& parent_id, & child_id| {
605
+ let parent_id = * dest_id_set. entry ( parent_id) . or_insert_with ( || parent_id) ;
606
+ let child_id = * dest_id_set. entry ( child_id) . or_insert_with ( || child_id) ;
607
+ dest_graph. add_edge ( parent_id, child_id, ( ) ) ;
607
608
}
608
609
) ;
609
610
// let source_graph = &self.imports.borrow().graph;
0 commit comments