mirror of
https://github.com/OldManAlpha/Puppeteer.git
synced 2025-11-28 23:48:35 +00:00
Port over cmatch optimization
This commit is contained in:
parent
391a78af1c
commit
312372df78
@ -68,9 +68,10 @@ function GetCaptures(pat)
|
||||
for a, b, c, d, e in gfind(gsub(pat, "%((.+)%)", "%1"), gsub(pat, "%d%$", "%%(.-)$")) do
|
||||
r[pat] = { a, b, c, d, e}
|
||||
end
|
||||
|
||||
r[pat] = r[pat] or {}
|
||||
end
|
||||
|
||||
if not r[pat] then return nil, nil, nil, nil end
|
||||
return r[pat][1], r[pat][2], r[pat][3], r[pat][4], r[pat][5]
|
||||
end
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user