From fd6b1be1b66e2b2a6db6d5049f32daaf2c5fba9b Mon Sep 17 00:00:00 2001 From: Mura Li <2606021+typeless@users.noreply.github.com> Date: Fri, 25 Jun 2021 02:37:07 +0800 Subject: [PATCH] Replace ARCCache with TwoQueueCache to avoid patent issue (#16240) Co-authored-by: Mura Li Co-authored-by: techknowlogick --- modules/highlight/highlight.go | 4 ++-- 1 file 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)) }