Skip to content

Commit d73460b

Browse files
committed
Bypass PutBack adaptor where possible because it doesn't specialize these methods either
1 parent 8dd9a05 commit d73460b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/merge_join.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ impl<I, J, F> Iterator for MergeJoinBy<I, J, F>
9090
loop {
9191
match (self.left.next(), self.right.next()) {
9292
(None, None) => break count,
93-
(Some(_left), None) => break count + 1 + self.left.count(),
94-
(None, Some(_right)) => break count + 1 + self.right.count(),
93+
(Some(_left), None) => break count + 1 + self.left.into_parts().1.count(),
94+
(None, Some(_right)) => break count + 1 + self.right.into_parts().1.count(),
9595
(Some(left), Some(right)) => {
9696
count += 1;
9797
match (self.cmp_fn)(&left, &right) {
@@ -110,10 +110,14 @@ impl<I, J, F> Iterator for MergeJoinBy<I, J, F>
110110
match (self.left.next(), self.right.next()) {
111111
(None, None) => break previous_element,
112112
(Some(left), None) => {
113-
break Some(EitherOrBoth::Left(self.left.last().unwrap_or(left)))
113+
break Some(EitherOrBoth::Left(
114+
self.left.into_parts().1.last().unwrap_or(left),
115+
))
114116
}
115117
(None, Some(right)) => {
116-
break Some(EitherOrBoth::Right(self.right.last().unwrap_or(right)))
118+
break Some(EitherOrBoth::Right(
119+
self.right.into_parts().1.last().unwrap_or(right),
120+
))
117121
}
118122
(Some(left), Some(right)) => {
119123
previous_element = match (self.cmp_fn)(&left, &right) {

0 commit comments

Comments
 (0)