forked from mirror/glob
This commit is contained in:
parent
9b07f114a0
commit
54004631f5
|
@ -83,16 +83,15 @@ 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
|
||||
|
||||
for offset < limit {
|
||||
// search for matching part in substring
|
||||
var index int
|
||||
index, segments = self.Value.Index(s[offset:limit], segments[:0])
|
||||
index, segments := self.Value.Index(s[offset:limit], segments[:0])
|
||||
if index == -1 {
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue