forked from mirror/glob
ttt
This commit is contained in:
parent
35629e8ad6
commit
205c640a14
|
@ -34,8 +34,7 @@ func (self AnyOf) Index(s string, segments []int) (int, []int) {
|
|||
var seg []int
|
||||
|
||||
for _, m := range self.Matchers {
|
||||
var idx int
|
||||
idx, seg = m.Index(s, seg[:0])
|
||||
idx, seg := m.Index(s, seg[:0])
|
||||
if idx == -1 {
|
||||
continue
|
||||
}
|
||||
|
|
|
@ -83,12 +83,11 @@ 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 := make([]int, 0, inputLen)
|
||||
// segments := acquireSegments(inputLen)
|
||||
// defer func() {
|
||||
// releaseSegments(segments)
|
||||
// }()
|
||||
var segments []int
|
||||
|
||||
for offset < limit {
|
||||
// search for matching part in substring
|
||||
|
|
Loading…
Reference in New Issue