Skip to content

Commit

Permalink
Create some slices with enough capacity (#1054)
Browse files Browse the repository at this point in the history
Signed-off-by: chenchen.ccqy66 <[email protected]>
  • Loading branch information
ccqy66 authored Jun 22, 2022
1 parent dc1d502 commit 1c59d17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bfe_http/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (h Header) Clone() Header {

// Keys get all keys from header
func (h Header) Keys() []string {
keys := make([]string, 0)
keys := make([]string, 0, len(h))
for key := range h {
keys = append(keys, key)
}
Expand Down
2 changes: 1 addition & 1 deletion bfe_modules/mod_redirect/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func actionConvert(actionFile ActionFile) Action {
}

func actionsConvert(actionFiles ActionFileList) []Action {
actions := make([]Action, 0)
actions := make([]Action, 0, len(actionFiles))

for _, actionFile := range actionFiles {
action := actionConvert(actionFile)
Expand Down

0 comments on commit 1c59d17

Please sign in to comment.