perf: Move variables to local scope

This commit is contained in:
oSumAtrIX 2024-12-01 09:25:30 +01:00
parent 7623b3ae18
commit 43c04216c6
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -12,12 +12,12 @@ lateinit var resourceMappings: List<ResourceElement>
private set
val resourceMappingPatch = resourcePatch {
val threadCount = Runtime.getRuntime().availableProcessors()
val threadPoolExecutor = Executors.newFixedThreadPool(threadCount)
val resourceMappings = Collections.synchronizedList(mutableListOf<ResourceElement>())
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()