File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -61,8 +61,7 @@ inline VariantData* ObjectImpl::addMember(TAdaptedString key) {
6161 if (!valueSlot)
6262 return nullptr ;
6363
64- VariantImpl keyImpl (keySlot.ptr (), resources_);
65- if (!keyImpl.setString (key))
64+ if (!VariantImpl::setString (key, keySlot.ptr (), resources_))
6665 return nullptr ;
6766
6867 CollectionImpl::appendPair (keySlot, valueSlot);
Original file line number Diff line number Diff line change @@ -480,7 +480,14 @@ class VariantImpl {
480480 void setRawString (SerializedValue<T> value);
481481
482482 template <typename TAdaptedString>
483- bool setString (TAdaptedString value);
483+ bool setString (TAdaptedString value) {
484+ if (!data_)
485+ return false ;
486+ return setString (value, data_, resources_);
487+ }
488+
489+ template <typename TAdaptedString>
490+ static bool setString (TAdaptedString value, VariantData*, ResourceManager*);
484491
485492 size_t size () {
486493 if (isObject ())
Original file line number Diff line number Diff line change @@ -19,11 +19,11 @@ inline void VariantImpl::setRawString(SerializedValue<T> value) {
1919}
2020
2121template <typename TAdaptedString>
22- inline bool VariantImpl::setString (TAdaptedString value) {
23- ARDUINOJSON_ASSERT ( isNull ()); // must call clear() first
24-
25- if (! data_)
26- return false ;
22+ inline bool VariantImpl::setString (TAdaptedString value, VariantData* data_,
23+ ResourceManager* resources_) {
24+ ARDUINOJSON_ASSERT (data_ != nullptr );
25+ ARDUINOJSON_ASSERT ( data_-> type == VariantType::Null);
26+ ARDUINOJSON_ASSERT (resources_ != nullptr ) ;
2727
2828 if (value.isNull ())
2929 return false ;
You can’t perform that action at this time.
0 commit comments