Compare two (references to) rows.
(
&self,
left_row: &RowRef,
right_row: &RowRef,
tiebreaker: impl Fn() -> Ordering,
)
| 3807 | |
| 3808 | /// Compare two (references to) rows. |
| 3809 | pub fn compare_rows( |
| 3810 | &self, |
| 3811 | left_row: &RowRef, |
| 3812 | right_row: &RowRef, |
| 3813 | tiebreaker: impl Fn() -> Ordering, |
| 3814 | ) -> Ordering { |
| 3815 | let order = if self.limit == 0 { |
| 3816 | Ordering::Equal |
| 3817 | } else { |
| 3818 | // These borrows should never fail, since this struct is non-sync and this function |
| 3819 | // is non-recursive. |
| 3820 | let mut left_ref = self.left_vec.borrow_mut(); |
| 3821 | let mut right_ref = self.right_vec.borrow_mut(); |
| 3822 | let left_cols = left_ref.borrow_with_limit(left_row, self.limit); |
| 3823 | let right_cols = right_ref.borrow_with_limit(right_row, self.limit); |
| 3824 | compare_columns(self.order.as_ref(), &left_cols, &right_cols, || { |
| 3825 | Ordering::Equal |
| 3826 | }) |
| 3827 | }; |
| 3828 | // Tiebreak without the vecs borrowed, in case that recursively invokes this function. |
| 3829 | order.then_with(tiebreaker) |
| 3830 | } |
| 3831 | } |
| 3832 | |
| 3833 | /// Compare `left` and `right` using `order`. If that doesn't produce a strict |
no test coverage detected