[aapt2] Close empty lists in "dump resources".
Bug: 129134933
Test: manual (b/129134933#comment4) since there's no Debug_test.cpp
Change-Id: Ib31481457089eade6f1d380cff4eeba0ff0c499d
diff --git a/tools/aapt2/Debug.cpp b/tools/aapt2/Debug.cpp
index 9832485..fbe1472 100644
--- a/tools/aapt2/Debug.cpp
+++ b/tools/aapt2/Debug.cpp
@@ -170,19 +170,17 @@
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(" ");
}
- printer_->Println("]");
+ PrintItem(*array->elements[i]);
+ if (i != count - 1) {
+ printer_->Print(", ");
+ }
}
+ printer_->Println("]");
}
void Visit(const Plural* plural) override {