From edaeb1b905371de7cae0db1da96d05c5b6a03802 Mon Sep 17 00:00:00 2001 From: deepdring Date: Wed, 20 Aug 2025 16:06:41 +0800 Subject: [PATCH] refactor: use the built-in max/min to simplify the code Signed-off-by: deepdring --- internal/helper/sdk/bech32.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/internal/helper/sdk/bech32.go b/internal/helper/sdk/bech32.go index 3a0e146..0e9e314 100644 --- a/internal/helper/sdk/bech32.go +++ b/internal/helper/sdk/bech32.go @@ -335,10 +335,7 @@ func ConvertBits(data []byte, fromBits, toBits uint8, pad bool) ([]byte, error) // The number of bytes to next extract is the minimum of // remFromBits and remToBits. - toExtract := remFromBits - if remToBits < toExtract { - toExtract = remToBits - } + toExtract := min(remToBits, remFromBits) // Add the next bits to nextByte, shifting the already // added bits to the left.