diff options
author | 2022-05-08 19:49:45 +0200 | |
---|---|---|
committer | 2022-05-08 18:49:45 +0100 | |
commit | 5004e0a9da665ccc0e18cd4075ee636641b71f0a (patch) | |
tree | b7c8269b954ced61afa9fffd7305bd88acca6f8e /vendor/codeberg.org/gruf/go-pools/bytes.go | |
parent | [bugfix] Fix existing bio text showing as HTML (#531) (diff) | |
download | gotosocial-5004e0a9da665ccc0e18cd4075ee636641b71f0a.tar.xz |
[bugfix] Fix remote media pruning failing if media already gone (#548)
* fix error check of prune to allow missing files
* update go-store library, add test for pruning item with db entry but no file
Signed-off-by: kim <grufwub@gmail.com>
* remove now-unneccessary error check
Signed-off-by: kim <grufwub@gmail.com>
Co-authored-by: kim <grufwub@gmail.com>
Diffstat (limited to 'vendor/codeberg.org/gruf/go-pools/bytes.go')
-rw-r--r-- | vendor/codeberg.org/gruf/go-pools/bytes.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/vendor/codeberg.org/gruf/go-pools/bytes.go b/vendor/codeberg.org/gruf/go-pools/bytes.go index 76fe18616..1aee77064 100644 --- a/vendor/codeberg.org/gruf/go-pools/bytes.go +++ b/vendor/codeberg.org/gruf/go-pools/bytes.go @@ -3,16 +3,16 @@ package pools import ( "sync" - "codeberg.org/gruf/go-bytes" + "codeberg.org/gruf/go-byteutil" ) // BufferPool is a pooled allocator for bytes.Buffer objects type BufferPool interface { // Get fetches a bytes.Buffer from pool - Get() *bytes.Buffer + Get() *byteutil.Buffer // Put places supplied bytes.Buffer in pool - Put(*bytes.Buffer) + Put(*byteutil.Buffer) } // NewBufferPool returns a newly instantiated bytes.Buffer pool @@ -20,7 +20,7 @@ func NewBufferPool(size int) BufferPool { return &bufferPool{ pool: sync.Pool{ New: func() interface{} { - return &bytes.Buffer{B: make([]byte, 0, size)} + return &byteutil.Buffer{B: make([]byte, 0, size)} }, }, size: size, @@ -33,11 +33,11 @@ type bufferPool struct { size int } -func (p *bufferPool) Get() *bytes.Buffer { - return p.pool.Get().(*bytes.Buffer) +func (p *bufferPool) Get() *byteutil.Buffer { + return p.pool.Get().(*byteutil.Buffer) } -func (p *bufferPool) Put(buf *bytes.Buffer) { +func (p *bufferPool) Put(buf *byteutil.Buffer) { if buf.Cap() < p.size { return } |