From 8f71a501a927a2144b83d1978d487ad845e40361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sun, 1 Dec 2024 15:50:32 +0000 Subject: [PATCH] remove now-redundant len shortcut in _originalNames MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As Paul Scheduikat points out, the loop already does not start if the length of name is less than minHashLength. │ old │ new │ │ sec/op │ sec/op vs base │ AbiOriginalNames-8 135.6µ ± 1% 135.5µ ± 0% ~ (p=1.000 n=7) --- reflect_abi_code.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/reflect_abi_code.go b/reflect_abi_code.go index 5b04a91..ce7b878 100644 --- a/reflect_abi_code.go +++ b/reflect_abi_code.go @@ -24,10 +24,6 @@ package main //disabledgo:linkname _originalNames internal/abi._originalNames func _originalNames(name string) string { - if len(name) < minHashLength { - // The name is too short to be obfuscated. - return name - } // We can stop once there aren't enough bytes to fit another obfuscated name. for i := 0; i <= len(name)-minHashLength; { switch name[i] {