Reduced the size of JsonHashTableBase::printTo() by 12 bytes

This commit is contained in:
Benoît Blanchon
2014-07-08 13:49:35 +02:00
parent e63cde3922
commit 0a0757945e

View File

@ -9,18 +9,18 @@ size_t JsonHashTableBase::printTo(Print& p) const
n += p.write('{'); n += p.write('{');
KeyValuePair* current = items; KeyValuePair* current = items;
for (int i = 0; i < count; i++) for (int i = count; i > 0; i--)
{ {
if (i > 0)
{
n += p.write(',');
}
n += current->key.printTo(p); n += current->key.printTo(p);
n += p.write(':'); n += p.write(':');
n += current->value.printTo(p); n += current->value.printTo(p);
current++; current++;
if (i > 1)
{
n += p.write(',');
}
} }
n += p.write('}'); n += p.write('}');