From 42fe2b2ac7debe61bfa8b63ef3bb41b774f12cdf Mon Sep 17 00:00:00 2001 From: Donald Chai Date: Tue, 7 May 2019 20:03:27 -0700 Subject: [aapt2] Close empty lists in "dump resources". Bug: 129134933 Test: manual (b/129134933#comment4) since there's no Debug_test.cpp Change-Id: Ib31481457089eade6f1d380cff4eeba0ff0c499d --- tools/aapt2/Debug.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'tools/aapt2/Debug.cpp') 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 { -- cgit v1.2.3-59-g8ed1b