mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-24 21:53:39 +09:00
Fixes https://github.com/go-gitea/gitea/issues/39395 `findActionKeywords` ran the close and reopen keyword patterns over all content before each reference, making `FindAllIssueReferences` quadratic on comments and commit messages. The patterns are anchored at the reference, so only the last few bytes can match. Scan only that window, sized from the longest keyword with room for `(?i)` matching wider runes like `ſ` for `s`. `"#1 "` repeated 4000 times: 2.04 s before, 16 ms after. --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>