dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit c9692df274284bcd5933c1180a6e2f511f3d1598
parent e9b5ffe82fd56d8ade8691af3f8ab2a7e8ffc7c9
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Mon, 30 Jan 2023 15:54:18 -0800

reuse buffer

Diffstat:
Mcmd/dkfupload/main.go | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/dkfupload/main.go b/cmd/dkfupload/main.go @@ -57,9 +57,9 @@ func main() { wg.Add(nbThreads) for i := 0; i < nbThreads; i++ { go func(i int, wg *sync.WaitGroup, chunksCh chan int64) { + buf := make([]byte, maxChunkSize) for chunkNum := range chunksCh { offset := int64(chunkNum) * maxChunkSize - buf := make([]byte, maxChunkSize) n, _ := f.ReadAt(buf, offset) log.Printf("Thread #%03d | chunk #%03d | read %d | from %d to %d\n", i, chunkNum, n, offset, offset+int64(n)) if !dry {