]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Removed unused mem_hdr methods (#1298)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Sat, 4 Mar 2023 18:09:05 +0000 (18:09 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 5 Mar 2023 22:37:02 +0000 (22:37 +0000)
Unused probably since 2003 commit 528b2c6.

src/stmem.cc
src/stmem.h

index 146cf9565632066afc35fde3af4d4c2cf9b1c0fe..33ef855548f52ef7f35f4e9bb7f43a60bd12a7bd 100644 (file)
@@ -100,13 +100,6 @@ mem_hdr::freeDataUpto(int64_t target_offset)
     return lowestOffset ();
 }
 
-int
-mem_hdr::appendToNode(mem_node *aNode, const char *data, int maxLength)
-{
-    size_t result = writeAvailable (aNode, aNode->nodeBuffer.offset + aNode->nodeBuffer.length,maxLength, data);
-    return result;
-}
-
 size_t
 mem_hdr::writeAvailable(mem_node *aNode, int64_t location, size_t amount, char const *source)
 {
@@ -139,35 +132,6 @@ mem_hdr::appendNode (mem_node *aNode)
     nodes.insert (aNode, NodeCompare);
 }
 
-void
-mem_hdr::makeAppendSpace()
-{
-    if (!nodes.size()) {
-        appendNode (new mem_node (0));
-        return;
-    }
-
-    if (!nodes.finish()->data->space())
-        appendNode (new mem_node (endOffset()));
-
-    assert (nodes.finish()->data->space());
-}
-
-void
-mem_hdr::internalAppend(const char *data, int len)
-{
-    debugs(19, 6, "memInternalAppend: " << this << " len " << len);
-
-    while (len > 0) {
-        makeAppendSpace();
-        int copied = appendToNode (nodes.finish()->data, data, len);
-        assert (copied);
-
-        len -= copied;
-        data += copied;
-    }
-}
-
 /* returns a mem_node that contains location..
  * If no node contains the start, it returns NULL.
  */
@@ -406,17 +370,6 @@ mem_hdr::size() const
     return nodes.size();
 }
 
-mem_node const *
-mem_hdr::start() const
-{
-    const SplayNode<mem_node *> * result = nodes.start();
-
-    if (result)
-        return result->data;
-
-    return nullptr;
-}
-
 const Splay<mem_node *> &
 mem_hdr::getNodes() const
 {
index d5e82d18df615a74464ab19d3c66d49e31926b06..1ca5495c8aa797fe7fe633a743480ce61804d913 100644 (file)
@@ -32,8 +32,6 @@ public:
     bool write (StoreIOBuffer const &);
     void dump() const;
     size_t size() const;
-    /* Not an iterator - thus the start, not begin() */
-    mem_node const *start() const;
     mem_node *getBlockContainingLocation (int64_t location) const;
     /* access the contained nodes - easier than punning
      * as a container ourselves
@@ -41,16 +39,11 @@ public:
     const Splay<mem_node *> &getNodes() const;
     char * NodeGet(mem_node * aNode);
 
-    /* Only for use of MemObject */
-    void internalAppend(const char *data, int len);
-
     static Splay<mem_node *>::SPLAYCMP NodeCompare;
 
 private:
     void debugDump() const;
     bool unlink(mem_node *aNode);
-    void makeAppendSpace();
-    int appendToNode(mem_node *aNode, const char *data, int maxLength);
     void appendNode (mem_node *aNode);
     size_t copyAvailable(mem_node *aNode, int64_t location, size_t amount, char *target) const;
     bool unionNotEmpty (StoreIOBuffer const &);