Skip to content

Commit

Permalink
Reduce the amount of cloning in reachability.rs (#374)
Browse files Browse the repository at this point in the history
* reduce the amount of cloning

* re-introduce derived Clone
  • Loading branch information
frankmcsherry authored Mar 25, 2021
1 parent ac0a326 commit 7f26146
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions timely/src/progress/reachability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ impl<T: Timestamp> Builder<T> {
/// This method has the opportunity to perform some error checking that the path summaries
/// are valid, including references to undefined nodes and ports, as well as self-loops with
/// default summaries (a serious liveness issue).
pub fn build(&self) -> (Tracker<T>, Vec<Vec<Antichain<T::Summary>>>) {
pub fn build(self) -> (Tracker<T>, Vec<Vec<Antichain<T::Summary>>>) {

if !self.is_acyclic() {
println!("Cycle detected without timestamp increment");
Expand Down Expand Up @@ -483,7 +483,7 @@ impl<T:Timestamp> Tracker<T> {
///
/// The result is a pair of tracker, and the summaries from each input port to each
/// output port.
pub fn allocate_from(builder: &Builder<T>) -> (Self, Vec<Vec<Antichain<T::Summary>>>) {
pub fn allocate_from(builder: Builder<T>) -> (Self, Vec<Vec<Antichain<T::Summary>>>) {

// Allocate buffer space for each input and input port.
let mut per_operator =
Expand Down Expand Up @@ -526,8 +526,8 @@ impl<T:Timestamp> Tracker<T> {

let tracker =
Tracker {
nodes: builder.nodes.clone(),
edges: builder.edges.clone(),
nodes: builder.nodes,
edges: builder.edges,
per_operator,
target_changes: ChangeBatch::new(),
source_changes: ChangeBatch::new(),
Expand Down

0 comments on commit 7f26146

Please sign in to comment.