Bläddra i källkod

Remove `VariantPool::capacity()`

Benoit Blanchon 2 år sedan
förälder
incheckning
0f3c73a211

+ 0 - 5
src/ArduinoJson/Memory/ResourceManager.hpp

@@ -43,11 +43,6 @@ class ResourceManager {
     return allocator_;
   }
 
-  // Gets the capacity of the memoryPool in bytes
-  size_t capacity() const {
-    return VariantPool::slotsToBytes(variantPools_.capacity());
-  }
-
   size_t size() const {
     return VariantPool::slotsToBytes(variantPools_.usage()) +
            stringPool_.size();

+ 0 - 1
src/ArduinoJson/Memory/VariantPool.hpp

@@ -49,7 +49,6 @@ class VariantPool {
   VariantSlot* getSlot(SlotId id) const;
   void clear();
   void shrinkToFit(Allocator*);
-  SlotCount capacity() const;
   SlotCount usage() const;
 
   static SlotCount bytesToSlots(size_t);

+ 0 - 4
src/ArduinoJson/Memory/VariantPoolImpl.hpp

@@ -49,10 +49,6 @@ inline SlotCount VariantPool::usage() const {
   return usage_;
 }
 
-inline SlotCount VariantPool::capacity() const {
-  return capacity_;
-}
-
 inline void VariantPool::clear() {
   usage_ = 0;
 }

+ 0 - 7
src/ArduinoJson/Memory/VariantPoolList.hpp

@@ -63,13 +63,6 @@ class VariantPoolList {
     capacity_ = 0;
   }
 
-  SlotCount capacity() const {
-    SlotCount total = 0;
-    for (size_t i = 0; i < count_; i++)
-      total = SlotCount(total + pools_[i].capacity());
-    return total;
-  }
-
   SlotCount usage() const {
     SlotCount total = 0;
     for (size_t i = 0; i < count_; i++)