Skip to content

Commit

Permalink
Merge commit 'c8b0369d6f27041bcae4556ba5bd1fa70ca8d1f3' into sorrycc-…
Browse files Browse the repository at this point in the history
…8a5n
  • Loading branch information
sorrycc committed Dec 27, 2023
2 parents 87fe570 + c8b0369 commit d643f49
Show file tree
Hide file tree
Showing 8 changed files with 218 additions and 245 deletions.
40 changes: 0 additions & 40 deletions crates/mako/src/bfs.rs

This file was deleted.

9 changes: 9 additions & 0 deletions crates/mako/src/chunk_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ impl ChunkGraph {
.collect::<Vec<ChunkId>>()
}

pub fn entry_dependencies_chunk(&self, chunk_id: &ChunkId) -> Vec<ChunkId> {
let idx = self.id_index_map.get(chunk_id).unwrap();
self.graph
.neighbors_directed(*idx, Direction::Outgoing)
.filter(|idx| matches!(self.graph[*idx].chunk_type, ChunkType::Entry(_, _, _)))
.map(|idx| self.graph[idx].id.clone())
.collect::<Vec<ChunkId>>()
}

pub fn dependents_chunk(&self, chunk_id: &ChunkId) -> Vec<ChunkId> {
let idx = self.id_index_map.get(chunk_id).unwrap();
self.graph
Expand Down
Loading

0 comments on commit d643f49

Please sign in to comment.