diff options
author | 2023-08-07 12:10:03 -0700 | |
---|---|---|
committer | 2023-08-07 12:11:00 -0700 | |
commit | 5ab833b904976f5b3c858ff1ddfbae7d1ed7d41a (patch) | |
tree | 3b33d0392865f07435ec5dfe0c8ed4e993fe1e0c | |
parent | a45b0177705af2513fe462374e695f7e7a070d12 (diff) |
Remove the no-op full_validation flag in the implementation details of cord.cc
PiperOrigin-RevId: 554552096
Change-Id: I0aa1bf705841c8bcee42bd33bc8d14bc15f2728b
-rw-r--r-- | absl/strings/cord.cc | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/absl/strings/cord.cc b/absl/strings/cord.cc index 14976aef..c5379de3 100644 --- a/absl/strings/cord.cc +++ b/absl/strings/cord.cc @@ -16,6 +16,7 @@ #include <algorithm> #include <atomic> +#include <cassert> #include <cstddef> #include <cstdio> #include <cstdlib> @@ -70,22 +71,11 @@ using ::absl::cord_internal::kMaxBytesToCopy; static void DumpNode(CordRep* rep, bool include_data, std::ostream* os, int indent = 0); -static bool VerifyNode(CordRep* root, CordRep* start_node, - bool full_validation); +static bool VerifyNode(CordRep* root, CordRep* start_node); static inline CordRep* VerifyTree(CordRep* node) { - // Verification is expensive, so only do it in debug mode. - // Even in debug mode we normally do only light validation. - // If you are debugging Cord itself, you should define the - // macro EXTRA_CORD_VALIDATION, e.g. by adding - // --copt=-DEXTRA_CORD_VALIDATION to the blaze line. -#ifdef EXTRA_CORD_VALIDATION - assert(node == nullptr || VerifyNode(node, node, /*full_validation=*/true)); -#else // EXTRA_CORD_VALIDATION - assert(node == nullptr || VerifyNode(node, node, /*full_validation=*/false)); -#endif // EXTRA_CORD_VALIDATION + assert(node == nullptr || VerifyNode(node, node)); static_cast<void>(&VerifyNode); - return node; } @@ -1310,8 +1300,7 @@ static std::string ReportError(CordRep* root, CordRep* node) { return buf.str(); } -static bool VerifyNode(CordRep* root, CordRep* start_node, - bool /* full_validation */) { +static bool VerifyNode(CordRep* root, CordRep* start_node) { absl::InlinedVector<CordRep*, 2> worklist; worklist.push_back(start_node); do { |