]> Cypherpunks repositories - gostls13.git/commit
net/http/cgi: replace constant map with switch statement
authorMatthew Dempsky <mdempsky@google.com>
Wed, 29 Apr 2020 23:45:05 +0000 (16:45 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 30 Apr 2020 00:13:38 +0000 (00:13 +0000)
commit844b410922b2ea7d22b651c536178e79696749f6
tree49a8c43fc8715d0b1b34c82fcb91a9d79114b5cc
parenta7e539619e5a73d9330f1698d710d99273651768
net/http/cgi: replace constant map with switch statement

The switch statement can be statically optimized by the compiler,
whereas similarly optimizing the map index expression would require
additional compiler analysis to detect the map is never mutated.

Updates #10848.

Change-Id: I2fc70d4a34dc545677b99f218b51023c7891bbbd
Reviewed-on: https://go-review.googlesource.com/c/go/+/231041
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/net/http/cgi/host.go