Skip to content
Permalink
Browse files

add extend, bump abom

  • Loading branch information...
frankmcsherry committed Aug 4, 2019
1 parent d05dc37 commit d12f2242b2d795ff26656779a4b759a219d20f7d
Showing with 22 additions and 2 deletions.
  1. +2 −2 timely/Cargo.toml
  2. +20 −0 timely/src/progress/frontier.rs
@@ -21,12 +21,12 @@ bincode= ["timely_communication/bincode"]
[dependencies]
serde = "1.0"
serde_derive = "1.0"
abomonation = "0.7"
abomonation = "0.7.3"
abomonation_derive = "0.3"
timely_bytes = { path = "../bytes", version = "0.10" }
timely_logging = { path = "../logging", version = "0.10" }
timely_communication = { path = "../communication", version = "0.10" }

[dev-dependencies]
timely_sort="0.1.6"
rand="0.4"
rand="0.4"
@@ -39,6 +39,26 @@ impl<T: PartialOrder> Antichain<T> {
}
}

/// Performs a sequence of insertion and return true iff any insertion does.
///
/// # Examples
///
///```
/// use timely::progress::frontier::Antichain;
///
/// let mut frontier = Antichain::new();
/// assert!(frontier.extend(Some(3)));
/// assert!(frontier.extend(vec![2, 5]));
/// assert!(!frontier.extend(vec![3, 4]));
///```
pub fn extend<I: IntoIterator<Item=T>>(&mut self, iterator: I) -> bool {
let mut added = false;
for element in iterator {
added = self.insert(element) || added;
}
added
}

/// Creates a new empty `Antichain`.
///
/// # Examples

0 comments on commit d12f224

Please sign in to comment.
You can’t perform that action at this time.