pub fn finish(&self, rows: &mut Vec<Row>) {
        let mut left_datum_vec = repr::DatumVec::new();
        let mut right_datum_vec = repr::DatumVec::new();
        let mut sort_by = |left: &Row, right: &Row| {
            let left_datums = left_datum_vec.borrow_with(left);
            let right_datums = right_datum_vec.borrow_with(right);
            compare_columns(&self.order_by, &left_datums, &right_datums, || {
                left.cmp(&right)
            })
        };
        let offset = self.offset;
        if offset > rows.len() {
            *rows = Vec::new();
        } else {
            if let Some(limit) = self.limit {
                let offset_plus_limit = offset + limit;
                if rows.len() > offset_plus_limit {
                    pdqselect::select_by(rows, offset_plus_limit, &mut sort_by);
                    rows.truncate(offset_plus_limit);
                }
            }
            if offset > 0 {
                pdqselect::select_by(rows, offset, &mut sort_by);
                rows.drain(..offset);
            }
            rows.sort_by(&mut sort_by);
            let mut row_packer = Row::default();
            let mut datum_vec = repr::DatumVec::new();
            for row in rows.iter_mut() {
                *row = {
                    let datums = datum_vec.borrow_with(&row);
                    row_packer.extend(self.project.iter().map(|i| &datums[*i]));
                    row_packer.finish_and_reuse()
                };
            }
        }
    }
/// Applies finishing actions to a row set.
Applies finishing actions to a row set.
Applies finishing actions to a row set .
pub fn finish(&self, rows: &mut Vec<Row>) {
        let mut left_datum_vec = repr::DatumVec::new();
        let mut right_datum_vec = repr::DatumVec::new();
        let mut sort_by = |left: &Row, right: &Row| {
            let left_datums = left_datum_vec.borrow_with(left);
            let right_datums = right_datum_vec.borrow_with(right);
            compare_columns(&self.order_by, &left_datums, &right_datums, || {
                left.cmp(&right)
            })
        };
        let offset = self.offset;
        if offset > rows.len() {
            *rows = Vec::new();
        } else {
            if let Some(limit) = self.limit {
                let offset_plus_limit = offset + limit;
                if rows.len() > offset_plus_limit {
                    pdqselect::select_by(rows, offset_plus_limit, &mut sort_by);
                    rows.truncate(offset_plus_limit);
                }
            }
            if offset > 0 {
                pdqselect::select_by(rows, offset, &mut sort_by);
                rows.drain(..offset);
            }
            rows.sort_by(&mut sort_by);
            let mut row_packer = Row::default();
            let mut datum_vec = repr::DatumVec::new();
            for row in rows.iter_mut() {
                *row = {
                    let datums = datum_vec.borrow_with(&row);
                    row_packer.extend(self.project.iter().map(|i| &datums[*i]));
                    row_packer.finish_and_reuse()
                };
            }
        }
    }
pub fn finish ( & self , rows : & mut Vec < Row > ) { let mut left_datum_vec = repr :: DatumVec :: new ( ) ; let mut right_datum_vec = repr :: DatumVec :: new ( ) ; let mut sort_by = | left : & Row , right : & Row | { let left_datums = left_datum_vec . borrow_with ( left ) ; let right_datums = right_datum_vec . borrow_with ( right ) ; compare_columns ( & self . order_by , & left_datums , & right_datums , | | { left . cmp ( & right ) } ) } ; let offset = self . offset ; if offset > rows . len ( ) { * rows = Vec :: new ( ) ; } else { if let Some ( limit ) = self . limit { let offset_plus_limit = offset + limit ; if rows . len ( ) > offset_plus_limit { pdqselect :: select_by ( rows , offset_plus_limit , & mut sort_by ) ; rows . truncate ( offset_plus_limit ) ; } } if offset > 0 { pdqselect :: select_by ( rows , offset , & mut sort_by ) ; rows . drain ( .. offset ) ; } rows . sort_by ( & mut sort_by ) ; let mut row_packer = Row :: default ( ) ; let mut datum_vec = repr :: DatumVec :: new ( ) ; for row in rows . iter_mut ( ) { * row = { let datums = datum_vec . borrow_with ( & row ) ; row_packer . extend ( self . project . iter ( ) . map ( | i | & datums [ * i ] ) ) ; row_packer . finish_and_reuse ( ) } ; } } }
Applies finishing actions to a row set.
Applies finishing actions to a row set .
&self
rows
&mut Vec<Row>
&self
rows
&mut Vec<Row>