Skip to content

Commit 6bb97f4

Browse files
committed
opt1
1 parent c8692f9 commit 6bb97f4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/lib.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,10 @@ where
7777

7878
// process simple case
7979
if xl == xr {
80-
for i in yl..yr {
81-
self.ye[i] = None;
82-
}
80+
self.ye[yl..yr].iter_mut().for_each(|x| *x = None);
8381
yr - yl
8482
} else if yl == yr {
85-
for i in xl..xr {
86-
self.xe[i] = None;
87-
}
83+
self.xe[xl..xr].iter_mut().for_each(|x| *x = None);
8884
xr - xl
8985

9086
// divide and conquer

0 commit comments

Comments
 (0)