mirror of
https://github.com/golang/go.git
synced 2025-10-30 16:20:58 +00:00
crypto/x509, go/scanner, index/suffixarray: Removed []interface{}/vector uses.
Changed some []interface{} uses to slices of the concrete types; removed use of IntVector.
R=gri, rsc
CC=golang-dev
https://golang.org/cl/4810085
This commit is contained in:
parent
5987a4ad29
commit
476150f4bf
3 changed files with 9 additions and 16 deletions
|
|
@ -6,7 +6,6 @@ package suffixarray
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"container/vector"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
|
|
@ -107,7 +106,7 @@ var testCases = []testCase{
|
|||
|
||||
// find all occurrences of s in source; report at most n occurrences
|
||||
func find(src, s string, n int) []int {
|
||||
var res vector.IntVector
|
||||
var res []int
|
||||
if s != "" && n != 0 {
|
||||
// find at most n occurrences of s in src
|
||||
for i := -1; n < 0 || len(res) < n; {
|
||||
|
|
@ -116,7 +115,7 @@ func find(src, s string, n int) []int {
|
|||
break
|
||||
}
|
||||
i += j + 1
|
||||
res.Push(i)
|
||||
res = append(res, i)
|
||||
}
|
||||
}
|
||||
return res
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue