Skip to content

Commit

Permalink
[Refactor] Remove the redundant wrapper function createMaps (#1427)
Browse files Browse the repository at this point in the history
The function `createMaps` only passes all arguments to
`buildAddHeaderMaps`. Hence, `createMaps` is redundant.
  • Loading branch information
kevin85421 authored Jan 3, 2024
1 parent c46ac28 commit f5b5e9e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions internal/mode/static/nginx/config/maps.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,10 @@ import (
var mapsTemplate = gotemplate.Must(gotemplate.New("maps").Parse(mapsTemplateText))

func executeMaps(conf dataplane.Configuration) []byte {
maps := createMaps(append(conf.HTTPServers, conf.SSLServers...))
maps := buildAddHeaderMaps(append(conf.HTTPServers, conf.SSLServers...))
return execute(mapsTemplate, maps)
}

func createMaps(servers []dataplane.VirtualServer) []http.Map {
return buildAddHeaderMaps(servers)
}

func buildAddHeaderMaps(servers []dataplane.VirtualServer) []http.Map {
addHeaderNames := make(map[string]struct{})

Expand Down

0 comments on commit f5b5e9e

Please sign in to comment.