From 35953f7764637c2db6305945a1524b3832341751 Mon Sep 17 00:00:00 2001 From: radik878 Date: Sat, 1 Nov 2025 01:40:18 +0200 Subject: [PATCH] common: avoid allocation in isHex by iterating string bytes directly --- common/bytes.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/bytes.go b/common/bytes.go index d1f5c6c995..0c9b98beee 100644 --- a/common/bytes.go +++ b/common/bytes.go @@ -62,8 +62,8 @@ func isHex(str string) bool { if len(str)%2 != 0 { return false } - for _, c := range []byte(str) { - if !isHexCharacter(c) { + for i := 0; i < len(str); i++ { + if !isHexCharacter(str[i]) { return false } }