summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-05-23 15:16:35 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-05-23 15:16:35 +0900
commitb4831ce8e91e6f27e3b241efd0c3fdfd8feca43a (patch)
tree7dbb5eced862d4905398ae47fd1af8eb0962d335
parent0ff4c8b20da26434f72bdb8597234704b8d8d5f8 (diff)
table: avoid unnecessary memory allocation about generating radix key
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--table/destination.go2
1 files changed, 1 insertions, 1 deletions
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]
}