aboutsummaryrefslogtreecommitdiff
path: root/ber
diff options
context:
space:
mode:
Diffstat (limited to 'ber')
-rw-r--r--ber/new/marshal.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/ber/new/marshal.go b/ber/new/marshal.go
index 45841ba..ed63be6 100644
--- a/ber/new/marshal.go
+++ b/ber/new/marshal.go
@@ -1,11 +1,11 @@
package ber
func lenLen(i int) int {
- var n int
+ n := 1
for ; i > 255; i >>= 8 {
n++
}
- return n + 1
+ return n
}
func (s *state) marshalLen(val int) {
@@ -30,14 +30,14 @@ func (s *state) marshalBool(val bool) {
}
func intLen(i int) int {
- var n int
+ n := 1
for ; i > 127; i >>= 8 {
n++
}
for ; i < -128; i >>= 8 {
n++
}
- return n + 1
+ return n
}
func (s *state) marshalInt(val int) {