Skip to content

Commit

Permalink
Reduce memory footprint of StringMatrix
Browse files Browse the repository at this point in the history
  • Loading branch information
plokhotnyuk committed Jan 12, 2025
1 parent 8411c4d commit 017c1ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions zio-json/shared/src/main/scala/zio/json/internal/lexer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,9 @@ final class StringMatrix(val xs: Array[String], aliases: Array[(String, Int)] =
}
m
}
private val resolve: Array[Int] = Array.tabulate[Int](width) { string =>
if (string < xs.length) string
else aliases(string - xs.length)._2
private val resolve: Array[Byte] = Array.tabulate[Byte](width) { string =>
if (string < xs.length) string.toByte
else aliases(string - xs.length)._2.toByte
}

// must be called with increasing `char` (starting with bitset obtained from a
Expand Down

0 comments on commit 017c1ef

Please sign in to comment.