|
@@ -79,7 +79,7 @@ class VariantSlot {
|
|
|
|
|
|
|
|
void setKey(const char* k, storage_policies::store_by_copy) {
|
|
void setKey(const char* k, storage_policies::store_by_copy) {
|
|
|
ARDUINOJSON_ASSERT(k != NULL);
|
|
ARDUINOJSON_ASSERT(k != NULL);
|
|
|
- _flags |= KEY_IS_OWNED;
|
|
|
|
|
|
|
+ _flags |= OWNED_KEY_BIT;
|
|
|
_key = k;
|
|
_key = k;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -94,7 +94,7 @@ class VariantSlot {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
bool ownsKey() const {
|
|
bool ownsKey() const {
|
|
|
- return (_flags & KEY_IS_OWNED) != 0;
|
|
|
|
|
|
|
+ return (_flags & OWNED_KEY_BIT) != 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void clear() {
|
|
void clear() {
|
|
@@ -104,9 +104,9 @@ class VariantSlot {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void movePointers(ptrdiff_t stringDistance, ptrdiff_t variantDistance) {
|
|
void movePointers(ptrdiff_t stringDistance, ptrdiff_t variantDistance) {
|
|
|
- if (_flags & KEY_IS_OWNED)
|
|
|
|
|
|
|
+ if (_flags & OWNED_KEY_BIT)
|
|
|
_key += stringDistance;
|
|
_key += stringDistance;
|
|
|
- if (_flags & VALUE_IS_OWNED)
|
|
|
|
|
|
|
+ if (_flags & OWNED_VALUE_BIT)
|
|
|
_content.asString += stringDistance;
|
|
_content.asString += stringDistance;
|
|
|
if (_flags & COLLECTION_MASK)
|
|
if (_flags & COLLECTION_MASK)
|
|
|
_content.asCollection.movePointers(stringDistance, variantDistance);
|
|
_content.asCollection.movePointers(stringDistance, variantDistance);
|