From d35d5b386ef7c670439d225413bceb79c3cdd19f Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Sun, 11 Jul 2021 16:07:36 -0400 Subject: [PATCH] Remove regex use in cache path generation --- src/main/kotlin/mdnet/cache/ImageStorage.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/kotlin/mdnet/cache/ImageStorage.kt b/src/main/kotlin/mdnet/cache/ImageStorage.kt index a798f5d..ce96495 100644 --- a/src/main/kotlin/mdnet/cache/ImageStorage.kt +++ b/src/main/kotlin/mdnet/cache/ImageStorage.kt @@ -366,7 +366,6 @@ class ImageStorage( private val JACKSON: ObjectMapper = jacksonObjectMapper() private fun String.toCachePath() = - this.substring(0, 3).replace(".(?!$)".toRegex(), "$0 ").split(" ".toRegex()).reversed() - .plus(this).joinToString(File.separator) + this.substring(0, 3).split("").reversed().drop(1).joinToString(File.separator) + this } }