From 4c772cda54896b0213b5eaffed81031e259f26d4 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 5 Aug 2013 15:46:06 -0700 Subject: all: use strings.IndexByte instead of Index where possible R=golang-dev, khr CC=golang-dev https://golang.org/cl/12486043 --- src/pkg/debug/gosym/symtab.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pkg/debug') diff --git a/src/pkg/debug/gosym/symtab.go b/src/pkg/debug/gosym/symtab.go index 9ab05bac2f..c6952af55c 100644 --- a/src/pkg/debug/gosym/symtab.go +++ b/src/pkg/debug/gosym/symtab.go @@ -40,7 +40,7 @@ func (s *Sym) Static() bool { return s.Type >= 'a' } // PackageName returns the package part of the symbol name, // or the empty string if there is none. func (s *Sym) PackageName() string { - if i := strings.Index(s.Name, "."); i != -1 { + if i := strings.IndexByte(s.Name, '.'); i != -1 { return s.Name[0:i] } return "" @@ -49,7 +49,7 @@ func (s *Sym) PackageName() string { // ReceiverName returns the receiver type name of this symbol, // or the empty string if there is none. func (s *Sym) ReceiverName() string { - l := strings.Index(s.Name, ".") + l := strings.IndexByte(s.Name, '.') r := strings.LastIndex(s.Name, ".") if l == -1 || r == -1 || l == r { return "" -- cgit v1.3