aboutsummaryrefslogtreecommitdiff
path: root/src/strings
diff options
context:
space:
mode:
Diffstat (limited to 'src/strings')
-rw-r--r--src/strings/strings.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/strings/strings.go b/src/strings/strings.go
index 7b8a6b536b..567a3c5bfa 100644
--- a/src/strings/strings.go
+++ b/src/strings/strings.go
@@ -185,14 +185,7 @@ func LastIndex(s, sep string) int {
case n == 0:
return len(s)
case n == 1:
- // special case worth making fast
- c := sep[0]
- for i := len(s) - 1; i >= 0; i-- {
- if s[i] == c {
- return i
- }
- }
- return -1
+ return LastIndexByte(s, sep[0])
case n == len(s):
if sep == s {
return 0