Skip to content

Commit

Permalink
move file id none assert check
Browse files Browse the repository at this point in the history
  • Loading branch information
vezenovm committed Jul 4, 2023
1 parent b63a436 commit 389e66e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/noirc_frontend/src/graph/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ impl CrateGraph {
self.arena.iter().filter(|(_, crate_data)| crate_data.root_file_id == file_id);

let next_file_id = roots_with_file_id.next();
assert!(next_file_id.is_none(), "you cannot add the same file id twice");

if let Some(file_id) = next_file_id {
return *file_id.0;
}

assert!(next_file_id.is_none(), "you cannot add the same file id twice");

let data = CrateData { root_file_id: file_id, crate_type, dependencies: Vec::new() };
let crate_id = CrateId(self.arena.len());
let prev = self.arena.insert(crate_id, data);
Expand Down

0 comments on commit 389e66e

Please sign in to comment.