Skip to content

Commit fd6b1be

Browse files
Replace ARCCache with TwoQueueCache to avoid patent issue (#16240)
Co-authored-by: Mura Li <[email protected]> Co-authored-by: techknowlogick <[email protected]>
1 parent 4cc63e9 commit fd6b1be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/highlight/highlight.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var (
3333

3434
once sync.Once
3535

36-
cache *lru.ARCCache
36+
cache *lru.TwoQueueCache
3737
)
3838

3939
// NewContext loads custom highlight map from local config
@@ -45,7 +45,7 @@ func NewContext() {
4545
}
4646

4747
// The size 512 is simply a conservative rule of thumb
48-
c, err := lru.NewARC(512)
48+
c, err := lru.New2Q(512)
4949
if err != nil {
5050
panic(fmt.Sprintf("failed to initialize LRU cache for highlighter: %s", err))
5151
}

0 commit comments

Comments
 (0)