| 185 | PatternList const& children() const { return fChildren; } |
| 186 | |
| 187 | virtual void fix_identities(UniquePatternSet& patterns) { |
| 188 | for(auto& child : fChildren) { |
| 189 | // this will fix up all its children, if needed |
| 190 | if (auto bp = dynamic_cast<BranchPattern*>(child.get())) { |
| 191 | bp->fix_identities(patterns); |
| 192 | } |
| 193 | |
| 194 | // then we try to add it to the list |
| 195 | auto inserted = patterns.insert(child); |
| 196 | if (!inserted.second) { |
| 197 | // already there? then reuse the existing shared_ptr for that thing |
| 198 | child = *inserted.first; |
| 199 | } |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | virtual size_t hash() const override { |
| 204 | size_t seed = typeid(*this).hash_code(); |
nothing calls this directly
no outgoing calls
no test coverage detected