mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Fix size()
This commit is contained in:
		| @@ -117,6 +117,10 @@ class VariantData { | ||||
|     return (_flags & COLLECTION_MASK) != 0; | ||||
|   } | ||||
|  | ||||
|   bool isPointer() const { | ||||
|     return type() == VALUE_IS_POINTER; | ||||
|   } | ||||
|  | ||||
|   template <typename T> | ||||
|   bool isInteger() const { | ||||
|     switch (type()) { | ||||
| @@ -259,7 +263,9 @@ class VariantData { | ||||
|   } | ||||
|  | ||||
|   size_t size() const { | ||||
|     return isCollection() ? _content.asCollection.size() : 0; | ||||
|     return isPointer()      ? _content.asPointer->size() | ||||
|            : isCollection() ? _content.asCollection.size() | ||||
|                             : 0; | ||||
|   } | ||||
|  | ||||
|   VariantData *addElement(MemoryPool *pool) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user