forked from mirror/glob
ttt
This commit is contained in:
parent
bff71ed368
commit
35629e8ad6
|
@ -83,11 +83,12 @@ func (self BTree) Match(s string) bool {
|
|||
|
||||
// reusable segments list
|
||||
// inputLen is the maximum size of output segments values
|
||||
// segments := acquireSegments(inputLen)
|
||||
// defer func() {
|
||||
// releaseSegments(segments)
|
||||
// }()
|
||||
var segments []int
|
||||
segments := acquireSegments(inputLen)
|
||||
defer func() {
|
||||
releaseSegments(segments)
|
||||
}()
|
||||
// var segments []int
|
||||
// segments := make([]int, 0, inputLen)
|
||||
|
||||
for offset < limit {
|
||||
// search for matching part in substring
|
||||
|
|
|
@ -55,8 +55,14 @@ type fakeMatcher struct {
|
|||
func (f *fakeMatcher) Match(string) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
var i = 3
|
||||
|
||||
func (f *fakeMatcher) Index(s string, seg []int) (int, []int) {
|
||||
return 0, append(seg, 1)
|
||||
for x := 0; x < i; x++ {
|
||||
seg = append(seg, x)
|
||||
}
|
||||
return 0, seg
|
||||
}
|
||||
func (f *fakeMatcher) Len() int {
|
||||
return f.len
|
||||
|
|
Loading…
Reference in New Issue