From b4831ce8e91e6f27e3b241efd0c3fdfd8feca43a Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Tue, 23 May 2017 15:16:35 +0900 Subject: table: avoid unnecessary memory allocation about generating radix key Signed-off-by: FUJITA Tomonori --- table/destination.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/table/destination.go b/table/destination.go index 2216abca..3535bbfe 100644 --- a/table/destination.go +++ b/table/destination.go @@ -53,7 +53,7 @@ const ( func IpToRadixkey(b []byte, max uint8) string { var buffer bytes.Buffer for i := 0; i < len(b) && i < int(max); i++ { - buffer.WriteString(fmt.Sprintf("%08b", b[i])) + fmt.Fprintf(&buffer, "%08b", b[i]) } return buffer.String()[:max] } -- cgit v1.2.3