We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3a41bb commit 2f66995Copy full SHA for 2f66995
compiler/src/dotty/tools/dotc/core/tasty/TastyString.scala
@@ -15,14 +15,7 @@ object TastyString {
15
/** Encode TASTY bytes into an Seq of String */
16
def pickle(bytes: Array[Byte]): Pickled = {
17
val str = new String(Base64.getEncoder().encode(bytes), UTF_8)
18
- def split(sliceEnd: Int, acc: List[String]): List[String] = {
19
- if (sliceEnd == 0) acc
20
- else {
21
- val sliceStart = (sliceEnd - maxStringSize) max 0
22
- split(sliceStart, str.substring(sliceStart, sliceEnd) :: acc)
23
- }
24
25
- split(str.length, Nil)
+ str.sliding(maxStringSize, maxStringSize).toList
26
}
27
28
/** Decode the TASTY String into TASTY bytes */
0 commit comments