1
0
mirror of https://github.com/mamoe/mirai.git synced 2025-03-25 06:50:09 +08:00

Fix AtomicResizeCacheList

This commit is contained in:
Him188 2020-04-15 17:55:54 +08:00
parent e1c1c35d70
commit f79d3f9aa0

View File

@ -48,7 +48,7 @@ internal class AtomicResizeCacheList<E>(private val retention: Long) {
for (cache in list) {
val instant = cache.time.value
when {
instant == currentTime -> {
instant == 0L -> {
if (cache.time.compareAndSet(instant, currentTime + retention)) {
cache.element = element
return