Concatenate another [`RowCollection`] onto `self`, copying and reallocating both sets of rows. This does not reorder the rows; the output will be sorted only if the inputs are.
(&mut self, other: &RowCollection)
| 96 | /// |
| 97 | /// This does not reorder the rows; the output will be sorted only if the inputs are. |
| 98 | pub fn concat(&mut self, other: &RowCollection) { |
| 99 | if other.count() == 0 { |
| 100 | return; |
| 101 | } |
| 102 | |
| 103 | // TODO(parkmycar): Using SegmentedBytes here would be nice. |
| 104 | let byte_len = self.rows.byte_len() + other.rows.byte_len(); |
| 105 | let len = self.rows.len() + other.rows.len(); |
| 106 | let mut builder = Self::builder(byte_len, len); |
| 107 | for (row, diff) in self.iter().chain(other.iter()) { |
| 108 | builder.push(row, diff); |
| 109 | } |
| 110 | *self = builder.build(); |
| 111 | } |
| 112 | |
| 113 | /// Adjust a row count for the provided offset and limit. |
| 114 | /// |