diff --git a/types/bech32/bech32.go b/types/bech32/bech32.go index dd183ad905c6..a1bde09e0bb8 100644 --- a/types/bech32/bech32.go +++ b/types/bech32/bech32.go @@ -304,7 +304,7 @@ func ConvertBits(data []byte, fromBits, toBits uint8, pad bool) ([]byte, error) for _, b := range data { // Discard unused bits. - b = b << (8 - fromBits) + b <<= (8 - fromBits) // How many bits remaining to extract from the input data. remFromBits := fromBits @@ -325,7 +325,7 @@ func ConvertBits(data []byte, fromBits, toBits uint8, pad bool) ([]byte, error) // Discard the bits we just extracted and get ready for // next iteration. - b = b << toExtract + b <<= toExtract remFromBits -= toExtract filledBits += toExtract @@ -341,7 +341,7 @@ func ConvertBits(data []byte, fromBits, toBits uint8, pad bool) ([]byte, error) // We pad any unfinished group if specified. if pad && filledBits > 0 { - nextByte = nextByte << (toBits - filledBits) + nextByte <<= (toBits - filledBits) regrouped = append(regrouped, nextByte) filledBits = 0 nextByte = 0