From c7ce85a1372b484cb7f4ff0c8764dad727ffb20b Mon Sep 17 00:00:00 2001 From: Lanius Trolling Date: Wed, 10 Apr 2024 19:40:45 -0400 Subject: [PATCH] Fix overflow --- src/jvmMain/kotlin/info/mechyrdia/lore/asset_caching.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jvmMain/kotlin/info/mechyrdia/lore/asset_caching.kt b/src/jvmMain/kotlin/info/mechyrdia/lore/asset_caching.kt index 8c6d1f6..f4e3da9 100644 --- a/src/jvmMain/kotlin/info/mechyrdia/lore/asset_caching.kt +++ b/src/jvmMain/kotlin/info/mechyrdia/lore/asset_caching.kt @@ -17,7 +17,7 @@ val StoragePathAttributeKey = AttributeKey("Mechyrdia.StoragePath") abstract class FileDependentCache { private inner class Entry(updated: Instant?, data: T?) { - private val updatedAtomic = AtomicLong((updated ?: Instant.MIN).toEpochMilli()) + private val updatedAtomic = AtomicLong(updated?.toEpochMilli() ?: Long.MIN_VALUE) val updated: Instant get() = Instant.ofEpochMilli(updatedAtomic.get()) @@ -28,7 +28,7 @@ abstract class FileDependentCache { private val updateLock = Mutex() private fun clear() { - updatedAtomic.set(Instant.MIN.toEpochMilli()) + updatedAtomic.set(Long.MIN_VALUE) dataAtomic.set(null) } -- 2.25.1