From 1fde99cd6eff725f5cc13748a43b4aef3de557c8 Mon Sep 17 00:00:00 2001 From: apocelipes Date: Thu, 14 Sep 2023 18:43:14 +0000 Subject: net: use bytealg.LastIndexByteString There is no need to handwrite the "last" function, the bytealg package already provides "LastIndexByteString". Change-Id: I6000705bffe8450a10cf8f3fa716a8d4605ada1f GitHub-Last-Rev: 6627c65fb40fad96239edd28bde27a30f9f8f544 GitHub-Pull-Request: golang/go#62647 Reviewed-on: https://go-review.googlesource.com/c/go/+/527976 Reviewed-by: Dmitri Shuralyov Reviewed-by: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI Auto-Submit: Ian Lance Taylor --- src/net/parse.go | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'src/net/parse.go') diff --git a/src/net/parse.go b/src/net/parse.go index f2e790e48f..29dffad43c 100644 --- a/src/net/parse.go +++ b/src/net/parse.go @@ -180,17 +180,6 @@ func xtoi2(s string, e byte) (byte, bool) { return byte(n), ok && ei == 2 } -// Index of rightmost occurrence of b in s. -func last(s string, b byte) int { - i := len(s) - for i--; i >= 0; i-- { - if s[i] == b { - break - } - } - return i -} - // hasUpperCase tells whether the given string contains at least one upper-case. func hasUpperCase(s string) bool { for i := range s { -- cgit v1.3-5-g9baa