[2.x] refactor: Use new Array instead of Array.fill (#8929)

This commit is contained in:
kenji yoshida 2026-03-20 09:18:47 +09:00 committed by GitHub
parent a6a1cf383e
commit b839d308e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -144,7 +144,7 @@ object EscHelpers {
* the length of the output string (which may be smaller than the returned array)
*/
def strip(bytes: Array[Byte], stripAnsi: Boolean, stripColor: Boolean): (Array[Byte], Int) = {
val res = Array.fill[Byte](bytes.length)(0)
val res = new Array[Byte](bytes.length)
var index = 0
var state = 0
var limit = 0
@ -199,7 +199,7 @@ object EscHelpers {
*/
def stripColorsAndMoves(s: String): String = {
val bytes = s.getBytes
val res = Array.fill[Byte](bytes.length)(0)
val res = new Array[Byte](bytes.length)
var index = 0
var state = 0
var limit = 0

View File

@ -15,7 +15,7 @@ libraryDependencies += "com.chuusai" %% "shapeless" % "2.3.41" from {
val os = new java.io.FileOutputStream(f)
var read = -1
val b = Array.fill[Byte](16*1024)(0)
val b = new Array[Byte](16*1024)
while ({
read = is.read(b)
read >= 0