diff options
author | Derek Mauro <dmauro@google.com> | 2024-03-19 12:12:12 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-03-19 12:13:00 -0700 |
commit | 8fe6b4233685a84aa2f8d2b14713073b39ea0cc2 (patch) | |
tree | eac8eace24b255c460af6209c53ee25893a3b541 /absl/strings | |
parent | 1980d7b98a0cae64432ccf9c4afebda5e21b2c5e (diff) | |
download | abseil-8fe6b4233685a84aa2f8d2b14713073b39ea0cc2.tar.gz abseil-8fe6b4233685a84aa2f8d2b14713073b39ea0cc2.tar.bz2 abseil-8fe6b4233685a84aa2f8d2b14713073b39ea0cc2.zip |
Remove vestigial variables in the DumpNode() helper in absl::Cord
Fixes #1636 (GCC -Wmaybe-uninitialized warning)
PiperOrigin-RevId: 617253727
Change-Id: I246cd21d8123d4dfa7780b1c4cac8ea1558a4067
Diffstat (limited to 'absl/strings')
-rw-r--r-- | absl/strings/cord.cc | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/absl/strings/cord.cc b/absl/strings/cord.cc index f67326fd..2b61bdfc 100644 --- a/absl/strings/cord.cc +++ b/absl/strings/cord.cc @@ -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, |