From 2a31bb32e131a765660ffd073af3c8d957fa8492 Mon Sep 17 00:00:00 2001 From: HotPotatoC Date: Mon, 29 Nov 2021 18:22:12 +0700 Subject: [PATCH] perf(protocol): append bool as byte instead of converting --- protocol/type.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol/type.go b/protocol/type.go index 8690808..15dc61e 100644 --- a/protocol/type.go +++ b/protocol/type.go @@ -65,9 +65,9 @@ func MakeBool(b bool) []byte { var bb []byte bb = append(bb, Integer) if b { - bb = strconv.AppendInt(bb, 1, 10) + bb = append(bb, byte('1')) } else { - bb = strconv.AppendInt(bb, 0, 10) + bb = append(bb, byte('0')) } bb = append(bb, CRLF...) return bb