Skip to content

Commit 21d60a1

Browse files
cuishuangrandall77
authored andcommitted
all: remove redundant type conversion
Change-Id: Ic6b210c1e5b99eef5c6e38d96feaf40e7e6033bb GitHub-Last-Rev: b8ecf76 GitHub-Pull-Request: #229 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/429016 Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
1 parent 183a9b7 commit 21d60a1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

bcrypt/bcrypt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (ih InvalidHashPrefixError) Error() string {
5050
type InvalidCostError int
5151

5252
func (ic InvalidCostError) Error() string {
53-
return fmt.Sprintf("crypto/bcrypt: cost %d is outside allowed range (%d,%d)", int(ic), int(MinCost), int(MaxCost))
53+
return fmt.Sprintf("crypto/bcrypt: cost %d is outside allowed range (%d,%d)", int(ic), MinCost, MaxCost)
5454
}
5555

5656
const (

cryptobyte/asn1.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ func (s *String) ReadASN1BitString(out *encoding_asn1.BitString) bool {
532532
return false
533533
}
534534

535-
paddingBits := uint8(bytes[0])
535+
paddingBits := bytes[0]
536536
bytes = bytes[1:]
537537
if paddingBits > 7 ||
538538
len(bytes) == 0 && paddingBits != 0 ||
@@ -554,7 +554,7 @@ func (s *String) ReadASN1BitStringAsBytes(out *[]byte) bool {
554554
return false
555555
}
556556

557-
paddingBits := uint8(bytes[0])
557+
paddingBits := bytes[0]
558558
if paddingBits != 0 {
559559
return false
560560
}

openpgp/armor/armor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func (r *openpgpReader) Read(p []byte) (n int, err error) {
156156
n, err = r.b64Reader.Read(p)
157157
r.currentCRC = crc24(r.currentCRC, p[:n])
158158

159-
if err == io.EOF && r.lReader.crcSet && r.lReader.crc != uint32(r.currentCRC&crc24Mask) {
159+
if err == io.EOF && r.lReader.crcSet && r.lReader.crc != r.currentCRC&crc24Mask {
160160
return 0, ArmorCorrupt
161161
}
162162

0 commit comments

Comments
 (0)