From f22ba1f24786be600bfa3686a7ce5a318a96b9c9 Mon Sep 17 00:00:00 2001 From: Marvin Stenger Date: Thu, 21 Sep 2017 19:01:27 +0200 Subject: 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 TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/unicode/maketables.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/unicode') diff --git a/src/unicode/maketables.go b/src/unicode/maketables.go index 9a92a0130a..dcfd471b05 100644 --- a/src/unicode/maketables.go +++ b/src/unicode/maketables.go @@ -680,7 +680,7 @@ func verifyRange(name string, inCategory Op, table *unicode.RangeTable) { } func parseScript(line string, scripts map[string][]Script) { - comment := strings.Index(line, "#") + comment := strings.IndexByte(line, '#') if comment >= 0 { line = line[0:comment] } -- cgit v1.3