Inlines those expressions that are indicated by should_inline. See `inline_expressions` for usage.
(&mut self, should_inline: Vec<bool>)
| 1319 | /// Inlines those expressions that are indicated by should_inline. |
| 1320 | /// See `inline_expressions` for usage. |
| 1321 | pub fn perform_inlining(&mut self, should_inline: Vec<bool>) { |
| 1322 | for index in 0..self.expressions.len() { |
| 1323 | let (prior, expr) = self.expressions.split_at_mut(index); |
| 1324 | expr[0].visit_mut_post(&mut |e| { |
| 1325 | if let Some(i) = e.as_column() { |
| 1326 | if should_inline[i] { |
| 1327 | *e = prior[i - self.input_arity].clone(); |
| 1328 | } |
| 1329 | } |
| 1330 | }); |
| 1331 | } |
| 1332 | for (_index, pred) in self.predicates.iter_mut() { |
| 1333 | let expressions = &self.expressions; |
| 1334 | pred.visit_mut_post(&mut |e| { |
| 1335 | if let Some(i) = e.as_column() { |
| 1336 | if should_inline[i] { |
| 1337 | *e = expressions[i - self.input_arity].clone(); |
| 1338 | } |
| 1339 | } |
| 1340 | }); |
| 1341 | } |
| 1342 | } |
| 1343 | |
| 1344 | /// Removes unused expressions from `self.expressions`. |
| 1345 | /// |
no test coverage detected