Skip to content

Commit

Permalink
refactor: Pre-size the class map
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios committed Jan 28, 2025
1 parent 567feef commit d7974ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/kotlin/app/revanced/patcher/util/PatchClasses.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class PatchClasses internal constructor(
) {

internal constructor(set: Set<ClassDef>) :
this(set.associateByTo(mutableMapOf()) { it.type })
this(set.associateByTo(HashMap<String, ClassDef>(set.size * 3 / 2)) { it.type })

internal fun addClass(classDef: ClassDef) {
pool[classDef.type] = classDef
Expand Down

0 comments on commit d7974ef

Please sign in to comment.