Skip to content

Commit

Permalink
use _count methods
Browse files Browse the repository at this point in the history
  • Loading branch information
luizirber committed Jan 19, 2021
1 parent e434bbd commit 5df958f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/src/sketch/nodegraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,13 @@ impl Nodegraph {
.bs
.iter()
.zip(&other.bs)
.map(|(bs, bs_other)| bs.intersection(bs_other).count())
.map(|(bs, bs_other)| bs.intersection_count(bs_other))
.sum();
let size: usize = self
.bs
.iter()
.zip(&other.bs)
.map(|(bs, bs_other)| bs.union(bs_other).count())
.map(|(bs, bs_other)| bs.union_count(bs_other))
.sum();
result as f64 / size as f64
}
Expand All @@ -332,7 +332,7 @@ impl Nodegraph {
.bs
.iter()
.zip(&other.bs)
.map(|(bs, bs_other)| bs.intersection(bs_other).count())
.map(|(bs, bs_other)| bs.intersection_count(bs_other))
.sum();
let size: usize = self.bs.iter().map(|bs| bs.len()).sum();
result as f64 / size as f64
Expand Down

0 comments on commit 5df958f

Please sign in to comment.