aboutsummaryrefslogtreecommitdiff
path: root/ber
diff options
context:
space:
mode:
Diffstat (limited to 'ber')
-rw-r--r--ber/unmarshal.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/ber/unmarshal.go b/ber/unmarshal.go
index 487fb02..350692b 100644
--- a/ber/unmarshal.go
+++ b/ber/unmarshal.go
@@ -71,14 +71,14 @@ func (s *state) unmarshalOID() OID {
}
func (s *state) unmarshalBitString() BitString {
- var bs BitString
b := s.next()
pad := int(b[0])
l := (len(b)-1)*8 - pad
+ bs := make(BitString, l)
for i := 0; i < l; i++ {
x := 1 + i/8
y := 7 - uint(i%8)
- bs = append(bs, b[x]&(1<<y) != 0)
+ bs[i] = b[x]&(1<<y) != 0
}
return bs
}