diff --git a/src/operators/iterate.rs b/src/operators/iterate.rs index f1e549ce0..b0d03fc74 100644 --- a/src/operators/iterate.rs +++ b/src/operators/iterate.rs @@ -188,10 +188,15 @@ impl Variable where G::Timestamp: Lattic /// Adds a new source of data to the `Variable`. pub fn set(self, result: &Collection) -> Collection { + let in_result = self.source.negate().concat(result); + self.set_concat(&in_result) + } + + + /// Concat a new source of data to the data already in the `Variable`. + pub fn set_concat(self, result: &Collection) -> Collection { let step = self.step; - self.source - .negate() - .concat(result) + result .inner .flat_map(move |(x,t,d)| step.results_in(&t).map(|t| (x,t,d))) .connect_loop(self.feedback); @@ -276,4 +281,4 @@ impl Deref for SemigroupVariable where fn deref(&self) -> &Self::Target { &self.collection } -} \ No newline at end of file +}