From 99230b49de346feea1e917cb3e3565310da86676 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Sat, 8 Feb 2025 16:05:35 -0500 Subject: [PATCH] Use new function signature for zeroLengthMatchState() --- regex/compile.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/regex/compile.go b/regex/compile.go index 03e9f54..8e010dc 100644 --- a/regex/compile.go +++ b/regex/compile.go @@ -816,7 +816,7 @@ func thompson(re []postfixNode) (Reg, error) { // In these cases, we will return an NFA with 1 state, with an assertion that is always true. if len(re) == 0 { start := zeroLengthMatchState() - nfa = append(nfa, &start) + nfa = append(nfa, start) } for _, c := range re { @@ -1068,14 +1068,14 @@ func thompson(re []postfixNode) (Reg, error) { nfa = append(nfa, s2) } tmp := zeroLengthMatchState() - s2 = &tmp + s2 = tmp } if err1 != nil || (s1.groupBegin && s1.numTransitions() == 0) { // Doesn't exist, or its just an LPAREN if err1 == nil { // See above for explanation nfa = append(nfa, s1) } tmp := zeroLengthMatchState() - s1 = &tmp + s1 = tmp } s3 := alternate(s1, s2) nfa = append(nfa, s3)