Skip to content

Commit

Permalink
perf: Move variables to local scope
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Dec 1, 2024
1 parent 7623b3a commit 43c0421
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 43c0421

Please sign in to comment.