Remove JsonDocument::garbageCollect()

This commit is contained in:
Benoit Blanchon
2023-07-25 14:37:25 +02:00
parent 00c9d8680a
commit a8329564e2
5 changed files with 1 additions and 69 deletions

View File

@@ -76,17 +76,6 @@ class JsonDocument : public detail::VariantOperators<const JsonDocument&> {
resources_.shrinkToFit();
}
// Reclaims the memory leaked when removing and replacing values.
// https://arduinojson.org/v6/api/jsondocument/garbagecollect/
bool garbageCollect() {
// make a temporary clone and swap
JsonDocument tmp(*this);
if (tmp.overflowed())
return false;
swap(*this, tmp);
return true;
}
// Casts the root to the specified type.
// https://arduinojson.org/v6/api/jsondocument/as/
template <typename T>