mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 16:14:05 +01:00
Removed the indirection via StringSlot
This commit is contained in:
@@ -20,13 +20,12 @@ class ZeroTerminatedFlashString {
|
||||
return !_str;
|
||||
}
|
||||
|
||||
template <typename TMemoryPool>
|
||||
StringSlot* save(TMemoryPool* memoryPool) const {
|
||||
char* save(MemoryPool* memoryPool) const {
|
||||
if (!_str) return NULL;
|
||||
size_t n = size() + 1; // copy the terminator
|
||||
StringSlot* slot = memoryPool->allocFrozenString(n);
|
||||
if (slot) memcpy_P(slot->value, reinterpret_cast<const char*>(_str), n);
|
||||
return slot;
|
||||
char* dup = memoryPool->allocFrozenString(n);
|
||||
if (dup) memcpy_P(dup, reinterpret_cast<const char*>(_str), n);
|
||||
return dup;
|
||||
}
|
||||
|
||||
size_t size() const {
|
||||
|
||||
Reference in New Issue
Block a user