From 4ee70e3869bb973990efbe25960ebd6030975ae8 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 1 Dec 2024 09:25:30 +0100 Subject: [PATCH] perf: Move variables to local scope --- .../patches/shared/misc/mapping/ResourceMappingPatch.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patches/src/main/kotlin/app/revanced/patches/shared/misc/mapping/ResourceMappingPatch.kt b/patches/src/main/kotlin/app/revanced/patches/shared/misc/mapping/ResourceMappingPatch.kt index 4368bace0..8a9e499dd 100644 --- a/patches/src/main/kotlin/app/revanced/patches/shared/misc/mapping/ResourceMappingPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/shared/misc/mapping/ResourceMappingPatch.kt @@ -12,12 +12,12 @@ lateinit var resourceMappings: List private set val resourceMappingPatch = resourcePatch { - val threadCount = Runtime.getRuntime().availableProcessors() - val threadPoolExecutor = Executors.newFixedThreadPool(threadCount) - val resourceMappings = Collections.synchronizedList(mutableListOf()) execute { + val threadCount = Runtime.getRuntime().availableProcessors() + val threadPoolExecutor = Executors.newFixedThreadPool(threadCount) + // Save the file in memory to concurrently read from it. val resourceXmlFile = get("res/values/public.xml").readBytes()