aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/cgi
diff options
context:
space:
mode:
authorMarvin Stenger <marvin.stenger94@gmail.com>2017-09-21 19:01:27 +0200
committerIan Lance Taylor <iant@golang.org>2017-09-25 17:35:41 +0000
commitf22ba1f24786be600bfa3686a7ce5a318a96b9c9 (patch)
tree06dd4fd49b65d66491a3674f8ed440fd44f52cc5 /src/net/http/cgi
parent5e92c411284f1757c3531a70530170f1079ee5fc (diff)
downloadgo-f22ba1f24786be600bfa3686a7ce5a318a96b9c9.tar.xz
all: prefer strings.IndexByte over strings.Index
strings.IndexByte was introduced in go1.2 and it can be used effectively wherever the second argument to strings.Index is exactly one byte long. This avoids generating unnecessary string symbols and saves a few calls to strings.Index. Change-Id: I1ab5edb7c4ee9058084cfa57cbcc267c2597e793 Reviewed-on: https://go-review.googlesource.com/65930 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/net/http/cgi')
-rw-r--r--src/net/http/cgi/child.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net/http/cgi/child.go b/src/net/http/cgi/child.go
index ec10108821..2c762bdba9 100644
--- a/src/net/http/cgi/child.go
+++ b/src/net/http/cgi/child.go
@@ -40,7 +40,7 @@ func Request() (*http.Request, error) {
func envMap(env []string) map[string]string {
m := make(map[string]string)
for _, kv := range env {
- if idx := strings.Index(kv, "="); idx != -1 {
+ if idx := strings.IndexByte(kv, '='); idx != -1 {
m[kv[:idx]] = kv[idx+1:]
}
}