Move clear definition

This commit is contained in:
Benoit Blanchon
2025-09-17 09:49:37 +02:00
parent 4d13c523ef
commit 769e10c8ed
2 changed files with 4 additions and 6 deletions

View File

@@ -481,7 +481,10 @@ class VariantImpl {
} }
// Release the resources used by this variant and set it to null. // Release the resources used by this variant and set it to null.
void clear(); void clear() {
if (data_)
clear(data_, resources_);
}
static void clear(VariantData* data, ResourceManager* resources); static void clear(VariantData* data, ResourceManager* resources);

View File

@@ -61,11 +61,6 @@ inline void VariantImpl::clear(VariantData* data_,
data_->type = VariantType::Null; data_->type = VariantType::Null;
} }
inline void VariantImpl::clear() {
if (data_)
clear(data_, resources_);
}
#if ARDUINOJSON_USE_8_BYTE_POOL #if ARDUINOJSON_USE_8_BYTE_POOL
inline const EightByteValue* VariantImpl::getEightByte() const { inline const EightByteValue* VariantImpl::getEightByte() const {
return type() & VariantTypeBits::EightByteBit return type() & VariantTypeBits::EightByteBit