diff options
author | Donald Chai <dchai@google.com> | 2019-05-07 20:03:27 -0700 |
---|---|---|
committer | Donald Chai <dchai@google.com> | 2019-05-07 21:08:36 -0700 |
commit | 42fe2b2ac7debe61bfa8b63ef3bb41b774f12cdf (patch) | |
tree | 92512af8a2547a7501ee630464de736e1d6d8c46 | |
parent | 08e8b1564bc3b3acdacfb62bafe00c8fbd26eeea (diff) |
[aapt2] Close empty lists in "dump resources".
Bug: 129134933
Test: manual (b/129134933#comment4) since there's no Debug_test.cpp
Change-Id: Ib31481457089eade6f1d380cff4eeba0ff0c499d
-rw-r--r-- | tools/aapt2/Debug.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/tools/aapt2/Debug.cpp b/tools/aapt2/Debug.cpp index 98324850f3f5..fbe147206d9c 100644 --- a/tools/aapt2/Debug.cpp +++ b/tools/aapt2/Debug.cpp @@ -170,19 +170,17 @@ class ValueBodyPrinter : public ConstValueVisitor { void Visit(const Array* array) override { const size_t count = array->elements.size(); printer_->Print("["); - if (count > 0) { - for (size_t i = 0u; i < count; i++) { - if (i != 0u && i % 4u == 0u) { - printer_->Println(); - printer_->Print(" "); - } - PrintItem(*array->elements[i]); - if (i != count - 1) { - printer_->Print(", "); - } + for (size_t i = 0u; i < count; i++) { + if (i != 0u && i % 4u == 0u) { + printer_->Println(); + printer_->Print(" "); + } + PrintItem(*array->elements[i]); + if (i != count - 1) { + printer_->Print(", "); } - printer_->Println("]"); } + printer_->Println("]"); } void Visit(const Plural* plural) override { |