diff options
author | Sergey Elantsev <elantsev.s@yandex.ru> | 2020-03-15 23:31:38 +0300 |
---|---|---|
committer | Sergey Elantsev <elantsev.s@yandex.ru> | 2020-03-15 23:31:38 +0300 |
commit | ff36bb98781c92fd8ec20c9a89c0c5a4f63b05da (patch) | |
tree | 388aa42c02c74ffc400ddab967e2ebae2f58f996 /pkg/packet/bgp/constant.go | |
parent | 2ef8db0290bbc938b3f6a2404cdd927663da3a00 (diff) |
optimized allocations in packet/bgp validations
Diffstat (limited to 'pkg/packet/bgp/constant.go')
-rw-r--r-- | pkg/packet/bgp/constant.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/packet/bgp/constant.go b/pkg/packet/bgp/constant.go index 5ea7b414..f05ee4f2 100644 --- a/pkg/packet/bgp/constant.go +++ b/pkg/packet/bgp/constant.go @@ -17,6 +17,7 @@ package bgp import ( "fmt" + "strconv" "strings" ) @@ -161,7 +162,7 @@ var BitmaskFlagOpValueMap = map[string]BitmaskFlagOp{ } func (f BitmaskFlagOp) String() string { - ops := make([]string, 0) + ops := make([]string, 0, 3) if f&BITMASK_FLAG_OP_AND > 0 { ops = append(ops, BitmaskFlagOpNameMap[BITMASK_FLAG_OP_AND]) } else { @@ -323,5 +324,5 @@ func (t EthernetType) String() string { if name, ok := EthernetTypeNameMap[t]; ok { return name } - return fmt.Sprintf("%d", t) + return strconv.Itoa(int(t)) } |