diff options
author | Mura Li <2606021+typeless@users.noreply.github.com> | 2021-06-25 02:37:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-24 14:37:07 -0400 |
commit | fd6b1be1b66e2b2a6db6d5049f32daaf2c5fba9b (patch) | |
tree | 3c6542eaf416ddaf4be1436c6cac733e04130ceb /modules | |
parent | 4cc63e9919486581f7acc49829ebf21bc52dd871 (diff) | |
download | gitea-fd6b1be1b66e2b2a6db6d5049f32daaf2c5fba9b.tar.gz gitea-fd6b1be1b66e2b2a6db6d5049f32daaf2c5fba9b.zip |
Replace ARCCache with TwoQueueCache to avoid patent issue (#16240)
Co-authored-by: Mura Li <typeless@users.noreply.github.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/highlight/highlight.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/highlight/highlight.go b/modules/highlight/highlight.go index e22e9d5b32..568035fbb7 100644 --- a/modules/highlight/highlight.go +++ b/modules/highlight/highlight.go @@ -33,7 +33,7 @@ var ( once sync.Once - cache *lru.ARCCache + cache *lru.TwoQueueCache ) // NewContext loads custom highlight map from local config @@ -45,7 +45,7 @@ func NewContext() { } // The size 512 is simply a conservative rule of thumb - c, err := lru.NewARC(512) + c, err := lru.New2Q(512) if err != nil { panic(fmt.Sprintf("failed to initialize LRU cache for highlighter: %s", err)) } |