From e63cde39222979fccc2fe3e9b1231fefb53e4e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Blanchon?= Date: Tue, 8 Jul 2014 13:46:34 +0200 Subject: [PATCH] Reducted the size of JsonHashTableBase::printTo() by 18 bytes ! --- JsonGenerator/JsonHashTableBase.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/JsonGenerator/JsonHashTableBase.cpp b/JsonGenerator/JsonHashTableBase.cpp index 504a8e86..e7d70300 100644 --- a/JsonGenerator/JsonHashTableBase.cpp +++ b/JsonGenerator/JsonHashTableBase.cpp @@ -8,6 +8,7 @@ size_t JsonHashTableBase::printTo(Print& p) const n += p.write('{'); + KeyValuePair* current = items; for (int i = 0; i < count; i++) { if (i > 0) @@ -15,9 +16,11 @@ size_t JsonHashTableBase::printTo(Print& p) const n += p.write(','); } - n += items[i].key.printTo(p); + n += current->key.printTo(p); n += p.write(':'); - n += items[i].value.printTo(p); + n += current->value.printTo(p); + + current++; } n += p.write('}');