mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
table: avoid unnecessary memory allocation about generating radix key
Signed-off-by: FUJITA Tomonori <[email protected]>
This commit is contained in:
@@ -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]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user