Skip to content

Commit

Permalink
minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ugoa committed May 3, 2020
1 parent 9e33ab8 commit f9334f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/rdd/rdd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1029,8 +1029,7 @@ pub trait Rdd: RddBase + 'static {
move |mut queue1: BoundedPriorityQueue<Self::Item>,
queue2: BoundedPriorityQueue<Self::Item>|
-> BoundedPriorityQueue<Self::Item> {
queue1.merge(queue2);
queue1
queue1.merge(queue2)
}
))?
.unwrap() as BoundedPriorityQueue<Self::Item>;
Expand Down
4 changes: 2 additions & 2 deletions src/utils/bounded_priority_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl<T: Data + Ord> BoundedPriorityQueue<T> {
}
}

pub fn merge(&mut self, other: BoundedPriorityQueue<T>) -> &Self {
pub fn merge(mut self, other: BoundedPriorityQueue<T>) -> Self {
other
.underlying
.into_iter()
Expand All @@ -43,7 +43,7 @@ impl<T: Data + Ord> BoundedPriorityQueue<T> {
}
}

pub(self) fn maybe_replace_lowest(&mut self, elem: T)
fn maybe_replace_lowest(&mut self, elem: T)
where
T: Data + Ord,
{
Expand Down

0 comments on commit f9334f8

Please sign in to comment.