]> source.dussan.org Git - gitea.git/commit
Speed up `enry.IsVendor` (#15213) (#15246)
authorzeripath <art27@cantab.net>
Thu, 1 Apr 2021 22:50:12 +0000 (23:50 +0100)
committerGitHub <noreply@github.com>
Thu, 1 Apr 2021 22:50:12 +0000 (00:50 +0200)
commit1a26f6c7abef670be624c38f626acd1dee5c2bfa
treee52ae3a7fd6258696aa197b6e4f6dfd97a4d4cdb
parent1062931cf19462cf5ff8d4f14eeead6c6fc58173
Speed up `enry.IsVendor` (#15213) (#15246)

Backport #15213

`enry.IsVendor` is kinda slow as it simply iterates across all regexps.
This PR ajdusts the regexps to combine them to make this process a
little quicker.

Related #15143

Signed-off-by: Andrew Thornton <art27@cantab.net>
modules/analyze/vendor.go [new file with mode: 0644]
modules/analyze/vendor_test.go [new file with mode: 0644]
modules/git/repo_language_stats.go
modules/indexer/code/bleve.go
modules/indexer/code/elastic_search.go