diff options
-rw-r--r-- | plumbing/cache/buffer_lru.go | 2 | ||||
-rw-r--r-- | plumbing/cache/object_lru.go | 2 |
2 files changed, 0 insertions, 4 deletions
diff --git a/plumbing/cache/buffer_lru.go b/plumbing/cache/buffer_lru.go index e86ccb2..acaf195 100644 --- a/plumbing/cache/buffer_lru.go +++ b/plumbing/cache/buffer_lru.go @@ -50,14 +50,12 @@ func (c *BufferLRU) Put(key int64, slice []byte) { oldBuf := ee.Value.(buffer) // in this case bufSize is a delta: new size - old size bufSize -= FileSize(len(oldBuf.Slice)) - c.ll.MoveToFront(ee) ee.Value = buffer{key, slice} } else { if bufSize > c.MaxSize { return } - ee := c.ll.PushFront(buffer{key, slice}) c.cache[key] = ee } diff --git a/plumbing/cache/object_lru.go b/plumbing/cache/object_lru.go index 31c0202..53d8b02 100644 --- a/plumbing/cache/object_lru.go +++ b/plumbing/cache/object_lru.go @@ -48,14 +48,12 @@ func (c *ObjectLRU) Put(obj plumbing.EncodedObject) { oldObj := ee.Value.(plumbing.EncodedObject) // in this case objSize is a delta: new size - old size objSize -= FileSize(oldObj.Size()) - c.ll.MoveToFront(ee) ee.Value = obj } else { if objSize > c.MaxSize { return } - ee := c.ll.PushFront(obj) c.cache[key] = ee } |