Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit d583aba

Browse files
Update src/binary_space_partition.rs
simplify is_leaf Co-authored-by: Ashleigh Carr <[email protected]>
1 parent 16917f1 commit d583aba

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/binary_space_partition.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,7 @@ impl Leaf {
149149
}
150150

151151
fn is_leaf(&self) -> bool {
152-
match self.left_child {
153-
None => match self.right_child {
154-
None => true,
155-
Some(_) => false,
156-
},
157-
Some(_) => false,
158-
}
152+
self.left_child.is_none() && self.right_child.is_none()
159153
}
160154

161155
fn generate(&mut self, rng: &mut StdRng) {

0 commit comments

Comments
 (0)