From 9714c2208b7c68ae2164357b0d7f56953d5b5c38 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Tue, 10 Aug 2010 09:50:21 -0700 Subject: [PATCH] asn1: remove superfluous if's, unused function R=adg CC=golang-dev https://golang.org/cl/1743059 --- src/pkg/asn1/marshal.go | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/src/pkg/asn1/marshal.go b/src/pkg/asn1/marshal.go index 328042b2b2c..4eecdf186e3 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