Improve options conditionals

This commit is contained in:
Lorenzo (Mec-iS)
2022-11-03 14:58:05 +00:00
parent ba70bb941f
commit b66afa9222
3 changed files with 6 additions and 9 deletions
+1 -1
View File
@@ -673,7 +673,7 @@ impl<TX: Number + PartialOrd, TY: Number + Ord, X: Array2<TX>, Y: Array1<TY>>
let mut is_pure = true;
for i in 0..n_rows {
if visitor.samples[i] > 0 {
if label == Option::None {
if label.is_none() {
label = Option::Some(visitor.y[i]);
} else if visitor.y[i] != label.unwrap() {
is_pure = false;