forked from bblanchon/ArduinoJson
Reduced code size
This commit is contained in:
@ -11,6 +11,7 @@
|
|||||||
#include <ArduinoJson/Json/Utf8.hpp>
|
#include <ArduinoJson/Json/Utf8.hpp>
|
||||||
#include <ArduinoJson/Memory/MemoryPool.hpp>
|
#include <ArduinoJson/Memory/MemoryPool.hpp>
|
||||||
#include <ArduinoJson/Numbers/parseNumber.hpp>
|
#include <ArduinoJson/Numbers/parseNumber.hpp>
|
||||||
|
#include <ArduinoJson/Polyfills/assert.hpp>
|
||||||
#include <ArduinoJson/Polyfills/type_traits.hpp>
|
#include <ArduinoJson/Polyfills/type_traits.hpp>
|
||||||
#include <ArduinoJson/Variant/VariantData.hpp>
|
#include <ArduinoJson/Variant/VariantData.hpp>
|
||||||
|
|
||||||
@ -115,8 +116,9 @@ class JsonDeserializer {
|
|||||||
NestingLimit nestingLimit) {
|
NestingLimit nestingLimit) {
|
||||||
if (nestingLimit.reached()) return DeserializationError::TooDeep;
|
if (nestingLimit.reached()) return DeserializationError::TooDeep;
|
||||||
|
|
||||||
// Check opening braket
|
// Skip opening braket
|
||||||
if (!eat('[')) return DeserializationError::InvalidInput;
|
ARDUINOJSON_ASSERT(current() == '[');
|
||||||
|
move();
|
||||||
|
|
||||||
// Skip spaces
|
// Skip spaces
|
||||||
DeserializationError err = skipSpacesAndComments();
|
DeserializationError err = skipSpacesAndComments();
|
||||||
@ -155,8 +157,9 @@ class JsonDeserializer {
|
|||||||
DeserializationError skipArray(NestingLimit nestingLimit) {
|
DeserializationError skipArray(NestingLimit nestingLimit) {
|
||||||
if (nestingLimit.reached()) return DeserializationError::TooDeep;
|
if (nestingLimit.reached()) return DeserializationError::TooDeep;
|
||||||
|
|
||||||
// Check opening braket
|
// Skip opening braket
|
||||||
if (!eat('[')) return DeserializationError::InvalidInput;
|
ARDUINOJSON_ASSERT(current() == '[');
|
||||||
|
move();
|
||||||
|
|
||||||
// Read each value
|
// Read each value
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@ -179,8 +182,9 @@ class JsonDeserializer {
|
|||||||
NestingLimit nestingLimit) {
|
NestingLimit nestingLimit) {
|
||||||
if (nestingLimit.reached()) return DeserializationError::TooDeep;
|
if (nestingLimit.reached()) return DeserializationError::TooDeep;
|
||||||
|
|
||||||
// Check opening brace
|
// Skip opening brace
|
||||||
if (!eat('{')) return DeserializationError::InvalidInput;
|
ARDUINOJSON_ASSERT(current() == '{');
|
||||||
|
move();
|
||||||
|
|
||||||
// Skip spaces
|
// Skip spaces
|
||||||
DeserializationError err = skipSpacesAndComments();
|
DeserializationError err = skipSpacesAndComments();
|
||||||
@ -241,8 +245,9 @@ class JsonDeserializer {
|
|||||||
DeserializationError skipObject(NestingLimit nestingLimit) {
|
DeserializationError skipObject(NestingLimit nestingLimit) {
|
||||||
if (nestingLimit.reached()) return DeserializationError::TooDeep;
|
if (nestingLimit.reached()) return DeserializationError::TooDeep;
|
||||||
|
|
||||||
// Check opening brace
|
// Skip opening brace
|
||||||
if (!eat('{')) return DeserializationError::InvalidInput;
|
ARDUINOJSON_ASSERT(current() == '{');
|
||||||
|
move();
|
||||||
|
|
||||||
// Skip spaces
|
// Skip spaces
|
||||||
DeserializationError err = skipSpacesAndComments();
|
DeserializationError err = skipSpacesAndComments();
|
||||||
|
Reference in New Issue
Block a user