Commit 8fe6b423 by Derek Mauro Committed by Copybara-Service

Remove vestigial variables in the DumpNode() helper in absl::Cord

Fixes #1636 (GCC -Wmaybe-uninitialized warning)

PiperOrigin-RevId: 617253727
Change-Id: I246cd21d8123d4dfa7780b1c4cac8ea1558a4067
parent 1980d7b9
......@@ -1451,8 +1451,6 @@ absl::string_view Cord::FlattenSlowPath() {
static void DumpNode(absl::Nonnull<CordRep*> rep, bool include_data,
absl::Nonnull<std::ostream*> os, int indent) {
const int kIndentStep = 1;
absl::InlinedVector<CordRep*, kInlinedVectorSize> stack;
absl::InlinedVector<int, kInlinedVectorSize> indents;
for (;;) {
*os << std::setw(3) << rep->refcount.Get();
*os << " " << std::setw(7) << rep->length;
......@@ -1477,26 +1475,23 @@ static void DumpNode(absl::Nonnull<CordRep*> rep, bool include_data,
if (rep->IsExternal()) {
*os << "EXTERNAL [";
if (include_data)
*os << absl::CEscape(std::string(rep->external()->base, rep->length));
*os << absl::CEscape(
absl::string_view(rep->external()->base, rep->length));
*os << "]\n";
} else if (rep->IsFlat()) {
*os << "FLAT cap=" << rep->flat()->Capacity() << " [";
if (include_data)
*os << absl::CEscape(std::string(rep->flat()->Data(), rep->length));
*os << absl::CEscape(
absl::string_view(rep->flat()->Data(), rep->length));
*os << "]\n";
} else {
CordRepBtree::Dump(rep, /*label=*/"", include_data, *os);
}
}
if (leaf) {
if (stack.empty()) break;
rep = stack.back();
stack.pop_back();
indent = indents.back();
indents.pop_back();
break;
}
}
ABSL_INTERNAL_CHECK(indents.empty(), "");
}
static std::string ReportError(absl::Nonnull<CordRep*> root,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment