aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/regexp/exec.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/regexp/exec.go')
-rw-r--r--libgo/go/regexp/exec.go14
1 files changed, 1 insertions, 13 deletions
diff --git a/libgo/go/regexp/exec.go b/libgo/go/regexp/exec.go
index 5182720..4fd61b5 100644
--- a/libgo/go/regexp/exec.go
+++ b/libgo/go/regexp/exec.go
@@ -19,7 +19,7 @@ type queue struct {
// A entry is an entry on a queue.
// It holds both the instruction pc and the actual thread.
// Some queue entries are just place holders so that the machine
-// knows it has considered that pc. Such entries have t == nil.
+// knows it has considered that pc. Such entries have t == nil.
type entry struct {
pc uint32
t *thread
@@ -107,14 +107,6 @@ func (m *machine) alloc(i *syntax.Inst) *thread {
return t
}
-// free returns t to the free pool.
-func (m *machine) free(t *thread) {
- m.inputBytes.str = nil
- m.inputString.str = ""
- m.inputReader.r = nil
- m.pool = append(m.pool, t)
-}
-
// match runs the machine over the input starting at pos.
// It reports whether a match was found.
// If so, m.matchcap holds the submatch information.
@@ -192,7 +184,6 @@ func (m *machine) match(i input, pos int) bool {
func (m *machine) clear(q *queue) {
for _, d := range q.dense {
if d.t != nil {
- // m.free(d.t)
m.pool = append(m.pool, d.t)
}
}
@@ -213,7 +204,6 @@ func (m *machine) step(runq, nextq *queue, pos, nextPos int, c rune, nextCond sy
continue
}
if longest && m.matched && len(t.cap) > 0 && m.matchcap[0] < t.cap[0] {
- // m.free(t)
m.pool = append(m.pool, t)
continue
}
@@ -232,7 +222,6 @@ func (m *machine) step(runq, nextq *queue, pos, nextPos int, c rune, nextCond sy
// First-match mode: cut off all lower-priority threads.
for _, d := range runq.dense[j+1:] {
if d.t != nil {
- // m.free(d.t)
m.pool = append(m.pool, d.t)
}
}
@@ -253,7 +242,6 @@ func (m *machine) step(runq, nextq *queue, pos, nextPos int, c rune, nextCond sy
t = m.add(nextq, i.Out, nextPos, t.cap, nextCond, t)
}
if t != nil {
- // m.free(t)
m.pool = append(m.pool, t)
}
}