Use maxOfMax in fixupMaxVersion

This commit is contained in:
2024-08-05 21:41:49 -07:00
parent 0201e27498
commit b4b469a175
+6 -5
View File
@@ -3033,14 +3033,15 @@ void fixupMaxVersion(Node *node, ConflictSet::Impl *impl, WriteContext *tls) {
} break;
case Type_Node48: {
auto *self48 = static_cast<Node48 *>(node);
self48->bitSet.forEachSet([&](int i) {
max = std::max(self48->childMaxVersion[self48->index[i]], max);
});
for (auto v : self48->maxOfMax) {
max = std::max(v, max);
}
} break;
case Type_Node256: {
auto *self256 = static_cast<Node256 *>(node);
self256->bitSet.forEachSet(
[&](int i) { max = std::max(self256->childMaxVersion[i], max); });
for (auto v : self256->maxOfMax) {
max = std::max(v, max);
}
} break;
default: // GCOVR_EXCL_LINE
__builtin_unreachable(); // GCOVR_EXCL_LINE