mirror of
https://github.com/v2rayA/v2rayA.git
synced 2026-11-20 23:02:25 +03:00
问题描述:
- lru.go 的 get() 函数使用了 PushFront(v) 而不是 MoveToFront(v)
- 这导致 list.Element 被重复添加到列表中,破坏了列表结构
- 当缓存淘汰时,back.Value 可能指向 *list.Element 而不是 *EncapsulatedValue
- 类型断言失败:interface{} is *list.Element, not *lru.EncapsulatedValue
修复方法:
- 将 l.list.PushFront(v) 改为 l.list.MoveToFront(v)
- MoveToFront 会将现有 element 移到列表前面,而不是创建新的 element
Fixes: interface conversion error in LRU cache