Skip to content

Commit

Permalink
fix: use short-circuting binary or.
Browse files Browse the repository at this point in the history
  • Loading branch information
rzvxa committed Jun 14, 2024
1 parent 575cc88 commit f99d838
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/oxc_semantic/src/control_flow/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl<'a> ControlFlowGraphBuilder<'a> {
pub fn add_edge(&mut self, a: BasicBlockId, b: BasicBlockId, weight: EdgeType) {
if matches!(weight, EdgeType::NewFunction) {
self.basic_block_mut(b).unreachable = false;
} else if matches!(weight, EdgeType::Unreachable) | self.basic_block(a).unreachable {
} else if matches!(weight, EdgeType::Unreachable) || self.basic_block(a).unreachable {
if self.graph.edges_directed(b, Direction::Incoming).count() == 0 {
self.basic_block_mut(b).unreachable = true;
}
Expand Down

0 comments on commit f99d838

Please sign in to comment.