Przeglądaj źródła

Reducted the size of JsonHashTableBase::printTo() by 18 bytes !

Benoît Blanchon 11 lat temu
rodzic
commit
e63cde3922
1 zmienionych plików z 5 dodań i 2 usunięć
  1. 5 2
      JsonGenerator/JsonHashTableBase.cpp

+ 5 - 2
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('}');