Remove performance-only code from debug build for increased coverage

This commit is contained in:
2024-03-18 16:21:55 -07:00
parent c31eebd5de
commit a5710b8282
335 changed files with 6 additions and 5 deletions

View File

@@ -2431,9 +2431,14 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl {
return;
}
this->oldestVersion = oldestVersion;
#ifdef NDEBUG
// This is here for performance reasons, since we want to amortize the cost
// of storing the search path as a string. In tests, we want to exercise the
// rest of the code often.
if (keyUpdates < 100) {
return;
}
#endif
Node *n = firstGeq(root, removalKey).n;
// There's no way to erase removalKey without introducing a key after it
assert(n != nullptr);
@@ -2461,9 +2466,6 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl {
removalKey = {};
return;
}
if (keyUpdates == 0) {
keyUpdates = 10;
}
removalKeyArena = Arena();
removalKey = getSearchPath(removalKeyArena, n);
}
@@ -2504,7 +2506,7 @@ int64_t &maxVersion(Node *n, ConflictSet::Impl *impl) {
return impl->rootMaxVersion;
}
switch (n->getType()) {
case Type_Node0:
case Type_Node0: // GCOVR_EXCL_LINE
__builtin_unreachable(); // GCOVR_EXCL_LINE
case Type_Node3: {
auto *n3 = static_cast<Node3 *>(n);