Skip to content

Commit

Permalink
optimize code
Browse files Browse the repository at this point in the history
Signed-off-by: QIUZHILEI <[email protected]>
  • Loading branch information
QIUZHILEI committed Jul 17, 2023
1 parent 9211003 commit a61660f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/engine/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ impl Graph {
})
.count();

while !queue.is_empty() {
let v = queue.pop().unwrap(); // This unwrap is ok since `queue` is not empty

while let Some(v)=queue.pop() {
sequence.push(v);
count += 1;

Expand Down

0 comments on commit a61660f

Please sign in to comment.