From f15f0d5839479f8511621b88fa4bdcca3b89cc32 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Sat, 14 Sep 2019 18:05:45 -0600 Subject: Eliminate some TODOs --- modules/caddyhttp/encode/encode.go | 2 +- modules/caddyhttp/matchers.go | 2 +- modules/caddyhttp/reverseproxy/reverseproxy.go | 6 +++--- modules/caddyhttp/routes.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'modules/caddyhttp') diff --git a/modules/caddyhttp/encode/encode.go b/modules/caddyhttp/encode/encode.go index 1838885..3716fc6 100644 --- a/modules/caddyhttp/encode/encode.go +++ b/modules/caddyhttp/encode/encode.go @@ -68,7 +68,7 @@ func (enc *Encode) Provision(ctx caddy.Context) error { return err } } - enc.EncodingsRaw = nil // allow GC to deallocate - TODO: Does this help? + enc.EncodingsRaw = nil // allow GC to deallocate if enc.MinLength == 0 { enc.MinLength = defaultMinLength diff --git a/modules/caddyhttp/matchers.go b/modules/caddyhttp/matchers.go index 23047d0..94d051e 100644 --- a/modules/caddyhttp/matchers.go +++ b/modules/caddyhttp/matchers.go @@ -418,7 +418,7 @@ func (m *MatchNegate) Provision(ctx caddy.Context) error { } m.matchers = append(m.matchers, val.(RequestMatcher)) } - m.matchersRaw = nil // allow GC to deallocate - TODO: Does this help? + m.matchersRaw = nil // allow GC to deallocate return nil } diff --git a/modules/caddyhttp/reverseproxy/reverseproxy.go b/modules/caddyhttp/reverseproxy/reverseproxy.go index 6a7ec70..485d14e 100644 --- a/modules/caddyhttp/reverseproxy/reverseproxy.go +++ b/modules/caddyhttp/reverseproxy/reverseproxy.go @@ -66,7 +66,7 @@ func (h *Handler) Provision(ctx caddy.Context) error { return fmt.Errorf("loading transport module: %s", err) } h.Transport = val.(http.RoundTripper) - h.TransportRaw = nil // allow GC to deallocate - TODO: Does this help? + h.TransportRaw = nil // allow GC to deallocate } if h.LoadBalancing != nil && h.LoadBalancing.SelectionPolicyRaw != nil { val, err := ctx.LoadModuleInline("policy", @@ -76,7 +76,7 @@ func (h *Handler) Provision(ctx caddy.Context) error { return fmt.Errorf("loading load balancing selection module: %s", err) } h.LoadBalancing.SelectionPolicy = val.(Selector) - h.LoadBalancing.SelectionPolicyRaw = nil // allow GC to deallocate - TODO: Does this help? + h.LoadBalancing.SelectionPolicyRaw = nil // allow GC to deallocate } if h.CBRaw != nil { val, err := ctx.LoadModuleInline("type", "http.handlers.reverse_proxy.circuit_breakers", h.CBRaw) @@ -84,7 +84,7 @@ func (h *Handler) Provision(ctx caddy.Context) error { return fmt.Errorf("loading circuit breaker module: %s", err) } h.CB = val.(CircuitBreaker) - h.CBRaw = nil // allow GC to deallocate - TODO: Does this help? + h.CBRaw = nil // allow GC to deallocate } if h.Transport == nil { diff --git a/modules/caddyhttp/routes.go b/modules/caddyhttp/routes.go index 1efbad6..108bb15 100644 --- a/modules/caddyhttp/routes.go +++ b/modules/caddyhttp/routes.go @@ -91,7 +91,7 @@ func (routes RouteList) Provision(ctx caddy.Context) error { } routes[i].MatcherSets = append(routes[i].MatcherSets, matchers) } - routes[i].MatcherSetsRaw = nil // allow GC to deallocate - TODO: Does this help? + routes[i].MatcherSetsRaw = nil // allow GC to deallocate // handlers for j, rawMsg := range route.HandlersRaw { @@ -101,7 +101,7 @@ func (routes RouteList) Provision(ctx caddy.Context) error { } routes[i].Handlers = append(routes[i].Handlers, mh.(MiddlewareHandler)) } - routes[i].HandlersRaw = nil // allow GC to deallocate - TODO: Does this help? + routes[i].HandlersRaw = nil // allow GC to deallocate } return nil } -- cgit v1.2.3