This commit is contained in:
gobwas 2016-02-22 20:32:28 +03:00
parent 9b07f114a0
commit 54004631f5
1 changed files with 6 additions and 7 deletions

View File

@ -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
}