From ddb24545b9764e3601c3c77dda2823aa83dd2d8d Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 12:58:24 +0100 Subject: [PATCH] ax(mining): replace prose comment with usage example on bufferPool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AX Principle 2: comments show HOW via concrete call, not WHAT via prose. The previous comment described the variable's purpose in prose — replaced with a direct usage example showing the Get/Reset/Put pattern. Co-Authored-By: Charon --- pkg/mining/bufpool.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/mining/bufpool.go b/pkg/mining/bufpool.go index 03f03f4..8d2034b 100644 --- a/pkg/mining/bufpool.go +++ b/pkg/mining/bufpool.go @@ -6,8 +6,7 @@ import ( "sync" ) -// bufferPool provides reusable byte buffers for JSON encoding. -// This reduces allocation overhead in hot paths like WebSocket event serialization. +// buf := bufferPool.Get().(*bytes.Buffer); buf.Reset(); defer bufferPool.Put(buf) var bufferPool = sync.Pool{ New: func() interface{} { return bytes.NewBuffer(make([]byte, 0, 1024))