Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/regexp/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,15 +519,15 @@ func (re *Regexp) doMatch(r io.RuneReader, b []byte, s string) bool {
//
// nil is returned if no matches are found and non-nil if matches are found.
func (re *Regexp) find(r io.RuneReader, b []byte, s string, pos int, ncap int, dstCap []int) []int {
if r == nil && len(b)+len(s) < re.minInputLen {
return nil
}

if dstCap == nil {
// Make sure 'return dstCap' is non-nil.
dstCap = arrayNoInts[:0:0]
}

if r == nil && len(b)+len(s) < re.minInputLen {
return nil
}

if re.onepass != nil {
return re.doOnePass(r, b, s, pos, ncap, dstCap)
}
Expand Down