aboutsummaryrefslogtreecommitdiff
path: root/ber/unmarshal.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-10-05 21:11:52 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-10-05 21:11:52 +0200
commit3d9786f40e6037ef5c5a27355df7fba9628b9c67 (patch)
treed65cbe3f9c8fe640ce07ea2f55e7ff54589e5d4d /ber/unmarshal.go
parent1382a51c0b5143b5962d9f6e58e237c19e5acf35 (diff)
Replace append with make
Diffstat (limited to 'ber/unmarshal.go')
-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
}