1
0
mirror of https://github.com/golang/go synced 2024-11-25 10:17:57 -07:00

asn1: remove superfluous if's, unused function

R=adg
CC=golang-dev
https://golang.org/cl/1743059
This commit is contained in:
Robert Griesemer 2010-08-10 09:50:21 -07:00
parent 7d3173fc1d
commit 9714c2208b

View File

@ -96,19 +96,6 @@ func marshalBase128Int(out *forkableWriter, n int64) (err os.Error) {
return nil return nil
} }
func base128Length(i int) (numBytes int) {
if i == 0 {
return 1
}
for i > 0 {
numBytes++
i >>= 7
}
return
}
func marshalInt64(out *forkableWriter, i int64) (err os.Error) { func marshalInt64(out *forkableWriter, i int64) (err os.Error) {
n := int64Length(i) n := int64Length(i)
@ -125,18 +112,14 @@ func marshalInt64(out *forkableWriter, i int64) (err os.Error) {
func int64Length(i int64) (numBytes int) { func int64Length(i int64) (numBytes int) {
numBytes = 1 numBytes = 1
if i > 0 { for i > 127 {
for i > 127 { numBytes++
numBytes++ i >>= 8
i >>= 8
}
} }
if i < 0 { for i < -128 {
for i < -128 { numBytes++
numBytes++ i >>= 8
i >>= 8
}
} }
return return