aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ber/common.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/ber/common.go b/ber/common.go
index b9e359a..aded3ef 100644
--- a/ber/common.go
+++ b/ber/common.go
@@ -62,16 +62,17 @@ func (o BitString) Equal(p BitString) bool {
}
func (o BitString) String() string {
- bmap := map[bool]string{
- true: "1",
- false: "0",
- }
var s string
for i, bit := range o {
if i != 0 && i%4 == 0 {
s += " "
}
- s += bmap[bit]
+ switch bit {
+ case true:
+ s += "1"
+ case false:
+ s += "0"
+ }
}
return s
}