checker: Use a couple of Rust idioms (#114)
This should have no functional change, just makes the source slightly easier to read and reason about.
This commit is contained in:
@@ -1001,8 +1001,7 @@ impl<'a, F: Function> Checker<'a, F> {
|
|||||||
queue_set.insert(block);
|
queue_set.insert(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
while !queue.is_empty() {
|
while let Some(block) = queue.pop() {
|
||||||
let block = queue.pop().unwrap();
|
|
||||||
queue_set.remove(&block);
|
queue_set.remove(&block);
|
||||||
let mut state = self.bb_in.get(&block).cloned().unwrap();
|
let mut state = self.bb_in.get(&block).cloned().unwrap();
|
||||||
trace!("analyze: block {} has state {:?}", block.index(), state);
|
trace!("analyze: block {} has state {:?}", block.index(), state);
|
||||||
@@ -1043,9 +1042,8 @@ impl<'a, F: Function> Checker<'a, F> {
|
|||||||
new_state
|
new_state
|
||||||
);
|
);
|
||||||
self.bb_in.insert(succ, new_state);
|
self.bb_in.insert(succ, new_state);
|
||||||
if !queue_set.contains(&succ) {
|
if queue_set.insert(succ) {
|
||||||
queue.push(succ);
|
queue.push(succ);
|
||||||
queue_set.insert(succ);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user