提交 2e40078f 编写于 作者: J Jonas Hietala 提交者: Alex Crichton

Place union as the first function, for consistency.

上级 9aaaa6b3
......@@ -729,6 +729,18 @@ pub fn iter<'a>(&'a self) -> BitPositions<'a> {
BitPositions {set: self, next_idx: 0}
}
/// Iterator over each uint stored in `self` union `other`
#[inline]
pub fn union<'a>(&'a self, other: &'a BitvSet) -> TwoBitPositions<'a> {
TwoBitPositions {
set: self,
other: other,
merge: |w1, w2| w1 | w2,
current_word: 0,
next_idx: 0
}
}
/// Iterator over each uint stored in the `self` setminus `other`
#[inline]
pub fn difference<'a>(&'a self, other: &'a BitvSet) -> TwoBitPositions<'a> {
......@@ -766,18 +778,6 @@ pub fn intersection<'a>(&'a self, other: &'a BitvSet) -> Take<TwoBitPositions<'a
}.take(min)
}
/// Iterator over each uint stored in `self` union `other`
#[inline]
pub fn union<'a>(&'a self, other: &'a BitvSet) -> TwoBitPositions<'a> {
TwoBitPositions {
set: self,
other: other,
merge: |w1, w2| w1 | w2,
current_word: 0,
next_idx: 0
}
}
/// Union in-place with the specified other bit vector
#[inline]
pub fn union_with(&mut self, other: &BitvSet) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册