(&mut self, count: usize, condition: bool)
| 155 | |
| 156 | #[inline(always)] |
| 157 | pub(crate) fn select_many(&mut self, count: usize, condition: bool) { |
| 158 | if count == 0 { |
| 159 | return; |
| 160 | } |
| 161 | |
| 162 | let len = self.data.len(); |
| 163 | let needed = count.checked_mul(2).unwrap_or_else(|| { |
| 164 | cold_path(); |
| 165 | unreachable!("Stack underflow, this is a bug"); |
| 166 | }); |
| 167 | |
| 168 | if len < needed { |
| 169 | cold_path(); |
| 170 | unreachable!("Stack underflow, this is a bug"); |
| 171 | } |
| 172 | |
| 173 | if !condition { |
| 174 | let dst = len - needed; |
| 175 | let src = len - count; |
| 176 | self.data.copy_within(src..len, dst); |
| 177 | } |
| 178 | |
| 179 | self.data.truncate(len - count); |
| 180 | } |
| 181 | } |
| 182 | impl ValueStack { |
| 183 | pub(crate) fn new(config: &Config) -> Self { |
no test coverage detected