]> Cypherpunks repositories - gostls13.git/commitdiff
archive/tar: remove useless type conversions
authorAwn <awn@cryptolosophy.io>
Mon, 3 Jul 2017 00:36:52 +0000 (01:36 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 15 Nov 2017 15:11:14 +0000 (15:11 +0000)
Change-Id: I259a6ed6a1abc63d2dc39eca7e85f94cf38001cc
Reviewed-on: https://go-review.googlesource.com/47342
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/archive/tar/format.go
src/archive/tar/strconv.go

index cf1289534f9908fe89716cbf9c967ebfceae5fdb..ed61f3ca0d13f40670e45b4c5caba618c1e1ffe9 100644 (file)
@@ -227,7 +227,7 @@ func (b *block) ComputeChecksum() (unsigned, signed int64) {
                if 148 <= i && i < 156 {
                        c = ' ' // Treat the checksum field itself as all spaces.
                }
-               unsigned += int64(uint8(c))
+               unsigned += int64(c)
                signed += int64(int8(c))
        }
        return unsigned, signed
index 8bbd65cd1acaf8866a226dcb2fd9a422d1fc1304..d144485a492496def9c647d2ecdfe9674b06cd72 100644 (file)
@@ -226,9 +226,9 @@ func parsePAXTime(s string) (time.Time, error) {
        }
        nsecs, _ := strconv.ParseInt(sn, 10, 64) // Must succeed
        if len(ss) > 0 && ss[0] == '-' {
-               return time.Unix(secs, -1*int64(nsecs)), nil // Negative correction
+               return time.Unix(secs, -1*nsecs), nil // Negative correction
        }
-       return time.Unix(secs, int64(nsecs)), nil
+       return time.Unix(secs, nsecs), nil
 }
 
 // formatPAXTime converts ts into a time of the form %d.%d as described in the