forked from bblanchon/ArduinoJson
Removed JsonValue::null(), moved the instance to JsonObjectBase
This commit is contained in:
1 parent
65e8b6d405
commit
5cc06180e6
5 files changed
+33
-15
No files matched your search
@@ -9,6 +9,10 @@
|
||||
using namespace ArduinoJson::Generator;
|
||||
using namespace ArduinoJson::Internals;
|
||||
|
||||
|
||||
JsonValue JsonObjectBase::nullValue;
|
||||
|
||||
|
||||
size_t JsonObjectBase::printTo(Print& p) const
|
||||
{
|
||||
size_t n = 0;
|
||||
@@ -51,10 +55,19 @@ JsonValue& JsonObjectBase::operator[](char const* key)
|
||||
p++;
|
||||
}
|
||||
|
||||
if (count >= capacity)
|
||||
return JsonValue::null();
|
||||
|
||||
count++;
|
||||
p->key = key;
|
||||
return p->value;
|
||||
JsonValue* value;
|
||||
|
||||
if (count < capacity)
|
||||
{
|
||||
count++;
|
||||
p->key = key;
|
||||
value = &p->value;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = &nullValue;
|
||||
}
|
||||
|
||||
value->reset();
|
||||
return *value;
|
||||
}
|
||||
Reference in new issue
Block a user