From 43c04216c6e647eaf6ad7e813eb5f0df0c108b77 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()