| 142 | |
| 143 | // Comparator for sort |
| 144 | struct ByGuarantee { |
| 145 | bool operator()(const Encoded& l, const Encoded& r) { |
| 146 | const auto cmp = l.guarantee.compare(r.guarantee); |
| 147 | if (cmp != 0) { |
| 148 | return cmp < 0; |
| 149 | } |
| 150 | // Equal guarantees; sort encodings with indices after encodings without |
| 151 | return (l.index ? 1 : 0) < (r.index ? 1 : 0); |
| 152 | } |
| 153 | }; |
| 154 | |
| 155 | // Comparator for building a Forest |
| 156 | struct IsAncestor { |