From df81d94b33c1842973ad195d53e1c10f48602b2e Mon Sep 17 00:00:00 2001 From: yeahgor <180073943+yhgrwav@users.noreply.github.com> Date: Mon, 15 Jun 2026 16:17:32 +0300 Subject: [PATCH] Update semaphore.go opmimized memory usage --- semaphore/semaphore.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/semaphore/semaphore.go b/semaphore/semaphore.go index 040c5bc..b4c3393 100644 --- a/semaphore/semaphore.go +++ b/semaphore/semaphore.go @@ -19,8 +19,7 @@ type waiter struct { // NewWeighted creates a new weighted semaphore with the given // maximum combined weight for concurrent access. func NewWeighted(n int64) *Weighted { - w := &Weighted{size: n} - return w + return &Weighted{size: n} } // Weighted provides a way to bound concurrent access to a resource.