Skip to content

Commit

Permalink
fix: remove Enum memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest authored Jun 12, 2024
1 parent 1e1051e commit 5b57ea0
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,18 @@ object PolySprintConfig : Config(
get() = displayCheck(PolySprint.player!!)

companion object {
private val items by lazy {
return@lazy if (KotlinVersion.CURRENT.isAtLeast(1, 9)) entries else values().toList()
}


val ToggleSprintHud.activeDisplay: String?
get() {
if (PolySprint.player == null) return null
return values().find { it.isActive }?.displayText?.invoke(this)
return items.find { it.isActive }?.displayText?.invoke(this)
}
}
}
}

}
}

0 comments on commit 5b57ea0

Please sign in to comment.