From 8bb63627f10ce87f3442db3732753310a90c8c39 Mon Sep 17 00:00:00 2001 From: Mura Li Date: Thu, 24 Jun 2021 18:33:11 +0800 Subject: [PATCH] Replace ARCCache with TwoQueueCache to avoid patent issue --- 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 e22e9d5b3266a..568035fbb7fb0 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)) }