mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
Change link() to shallowCopy() (issue #1343)
Instead of storing a pointer, the function copies the `VariantData`. Benefits: * smaller code * no impact on programs that don't use this feature Drawbacks: * changes to the original variant are not always reflected on the copy * modifying the original from the shallow copy leads to UB
This commit is contained in:
@@ -31,8 +31,6 @@ enum {
|
||||
VALUE_IS_SIGNED_INTEGER = 0x0A,
|
||||
VALUE_IS_FLOAT = 0x0C,
|
||||
|
||||
VALUE_IS_POINTER = 0x10,
|
||||
|
||||
COLLECTION_MASK = 0x60,
|
||||
VALUE_IS_OBJECT = 0x20,
|
||||
VALUE_IS_ARRAY = 0x40,
|
||||
@@ -51,7 +49,6 @@ union VariantContent {
|
||||
UInt asUnsignedInteger;
|
||||
Integer asSignedInteger;
|
||||
CollectionData asCollection;
|
||||
const class VariantData *asPointer;
|
||||
struct {
|
||||
const char *data;
|
||||
size_t size;
|
||||
|
||||
Reference in New Issue
Block a user