Skip to content

Commit

Permalink
Improve char size loading speed
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteZ1337 committed Apr 16, 2023
1 parent 59b0ea3 commit f90debc
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import com.google.common.cache.CacheBuilder
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.format.TextDecoration
import xyz.xenondevs.nova.LOGGER
import xyz.xenondevs.nova.NOVA
import xyz.xenondevs.nova.data.config.DEFAULT_CONFIG
import xyz.xenondevs.nova.data.config.configReloadable
import xyz.xenondevs.nova.initialize.InitFun
import xyz.xenondevs.nova.initialize.InitializationStage
import xyz.xenondevs.nova.initialize.InternalInit
import xyz.xenondevs.nova.util.component.adventure.chars
import java.io.ByteArrayInputStream
import java.io.DataInputStream
import java.io.DataOutputStream
import java.io.File
Expand Down Expand Up @@ -285,9 +285,9 @@ internal class CharSizeTable(
companion object {

fun load(file: File): CharSizeTable {
LOGGER.info("Loading char size table: $file...")
file.inputStream().use {
val din = DataInputStream(it)
val bytes = it.readAllBytes()
val din = DataInputStream(ByteArrayInputStream(bytes))
val sizes = Int2ObjectOpenHashMap<IntArray>()

while (din.available() >= 16) {
Expand Down

0 comments on commit f90debc

Please sign in to comment.