From: Robert Griesemer Date: Tue, 10 Aug 2010 16:50:21 +0000 (-0700) Subject: asn1: remove superfluous if's, unused function X-Git-Tag: weekly.2010-08-11~16 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9714c2208b7c68ae2164357b0d7f56953d5b5c38;p=gostls13.git asn1: remove superfluous if's, unused function R=adg CC=golang-dev https://golang.org/cl/1743059 --- diff --git a/src/pkg/asn1/marshal.go b/src/pkg/asn1/marshal.go index 328042b2b2..4eecdf186e 100644 --- a/src/pkg/asn1/marshal.go +++ b/src/pkg/asn1/marshal.go @@ -96,19 +96,6 @@ func marshalBase128Int(out *forkableWriter, n int64) (err os.Error) { 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) { n := int64Length(i) @@ -125,18 +112,14 @@ func marshalInt64(out *forkableWriter, i int64) (err os.Error) { func int64Length(i int64) (numBytes int) { numBytes = 1 - if i > 0 { - for i > 127 { - numBytes++ - i >>= 8 - } + for i > 127 { + numBytes++ + i >>= 8 } - if i < 0 { - for i < -128 { - numBytes++ - i >>= 8 - } + for i < -128 { + numBytes++ + i >>= 8 } return