mirror of
https://github.com/golang/go
synced 2024-11-19 21:54:40 -07:00
archive/tar: remove useless type conversions
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>
This commit is contained in:
parent
894743b56e
commit
23c9db657e
@ -227,7 +227,7 @@ func (b *block) ComputeChecksum() (unsigned, signed int64) {
|
|||||||
if 148 <= i && i < 156 {
|
if 148 <= i && i < 156 {
|
||||||
c = ' ' // Treat the checksum field itself as all spaces.
|
c = ' ' // Treat the checksum field itself as all spaces.
|
||||||
}
|
}
|
||||||
unsigned += int64(uint8(c))
|
unsigned += int64(c)
|
||||||
signed += int64(int8(c))
|
signed += int64(int8(c))
|
||||||
}
|
}
|
||||||
return unsigned, signed
|
return unsigned, signed
|
||||||
|
@ -226,9 +226,9 @@ func parsePAXTime(s string) (time.Time, error) {
|
|||||||
}
|
}
|
||||||
nsecs, _ := strconv.ParseInt(sn, 10, 64) // Must succeed
|
nsecs, _ := strconv.ParseInt(sn, 10, 64) // Must succeed
|
||||||
if len(ss) > 0 && ss[0] == '-' {
|
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
|
// formatPAXTime converts ts into a time of the form %d.%d as described in the
|
||||||
|
Loading…
Reference in New Issue
Block a user