Insert subtrees for each component of an encoded partition expression.
| 113 | |
| 114 | // Insert subtrees for each component of an encoded partition expression. |
| 115 | void GenerateSubtrees(expression_codes guarantee, std::vector<Encoded>* encoded) { |
| 116 | while (!guarantee.empty()) { |
| 117 | if (subtree_exprs_.insert(guarantee).second) { |
| 118 | Encoded encoded_subtree{/*index=*/std::nullopt, guarantee}; |
| 119 | encoded->push_back(std::move(encoded_subtree)); |
| 120 | } |
| 121 | guarantee.resize(guarantee.size() - 1); |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | // Encode a guarantee, and generate subtrees for it as well. |
| 126 | void EncodeOneGuarantee(int index, const Expression& guarantee, |