Skip to content

Commit 5653662

Browse files
committed
Remove loop check in bit vec iter
1 parent 247b5dc commit 5653662

File tree

3 files changed

+2
-197
lines changed

3 files changed

+2
-197
lines changed

libraries/path-bool/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ mod util {
1212
pub(crate) mod grid;
1313
pub(crate) mod math;
1414
pub(crate) mod quad_tree;
15-
pub(crate) mod rtree;
1615
}
1716
mod path;
1817
#[cfg(test)]

libraries/path-bool/src/util/grid.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,14 @@ impl Grid {
4949
}
5050
}
5151

52-
use std::mem::size_of;
53-
5452
pub struct BitVec {
5553
data: Vec<u64>,
56-
capacity: usize,
5754
}
5855

5956
impl BitVec {
6057
pub fn new(capacity: usize) -> Self {
6158
let num_words = (capacity + 63) / 64;
62-
BitVec { data: vec![0; num_words], capacity }
59+
BitVec { data: vec![0; num_words] }
6360
}
6461

6562
pub fn set(&mut self, index: usize) {
@@ -91,7 +88,7 @@ impl<'a> Iterator for BitVecIterator<'a> {
9188
type Item = usize;
9289

9390
fn next(&mut self) -> Option<Self::Item> {
94-
while self.word_index < self.bit_vec.data.len() {
91+
loop {
9592
if self.current_word == 0 {
9693
self.word_index += 1;
9794
if self.word_index == self.bit_vec.data.len() {
@@ -107,7 +104,6 @@ impl<'a> Iterator for BitVecIterator<'a> {
107104

108105
return Some(result);
109106
}
110-
None
111107
}
112108
}
113109

libraries/path-bool/src/util/rtree.rs

-190
This file was deleted.

0 commit comments

Comments
 (0)