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
|
var seg []int
|
||||||
|
|
||||||
for _, m := range self.Matchers {
|
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 {
|
if idx == -1 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,12 +83,11 @@ func (self BTree) Match(s string) bool {
|
||||||
|
|
||||||
// reusable segments list
|
// reusable segments list
|
||||||
// inputLen is the maximum size of output segments values
|
// inputLen is the maximum size of output segments values
|
||||||
segments := acquireSegments(inputLen)
|
// segments := acquireSegments(inputLen)
|
||||||
defer func() {
|
// defer func() {
|
||||||
releaseSegments(segments)
|
// releaseSegments(segments)
|
||||||
}()
|
// }()
|
||||||
// var segments []int
|
var segments []int
|
||||||
// segments := make([]int, 0, inputLen)
|
|
||||||
|
|
||||||
for offset < limit {
|
for offset < limit {
|
||||||
// search for matching part in substring
|
// search for matching part in substring
|
||||||
|
|
Loading…
Reference in New Issue