Skip to content

Commit 4d1d67a

Browse files
committed
Use StringBuilder.setLength
Compiler complains with new Scala 2.13 collection reassignment to val cbuf.length = 0 ^
1 parent b133117 commit 4d1d67a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Diff for: shared/src/main/scala/scala/xml/parsing/MarkupParser.scala

+8-8
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ trait MarkupParser extends MarkupParserCommon with TokenTests {
358358
}
359359
nextch()
360360
val str = cbuf.toString()
361-
cbuf.length = 0
361+
cbuf.setLength(0)
362362
str
363363
}
364364

@@ -390,7 +390,7 @@ trait MarkupParser extends MarkupParserCommon with TokenTests {
390390
xToken("--")
391391
while (!eof) {
392392
if (ch == '-' && { sb.append(ch); nextch(); ch == '-' }) {
393-
sb.length = sb.length - 1
393+
sb.setLength(sb.length - 1)
394394
nextch()
395395
xToken('>')
396396
return handle.comment(pos, sb.toString())
@@ -608,7 +608,7 @@ trait MarkupParser extends MarkupParserCommon with TokenTests {
608608
exit = eof || (ch == '<') || (ch == '&')
609609
}
610610
val str = cbuf.toString
611-
cbuf.length = 0
611+
cbuf.setLength(0)
612612
str
613613
}
614614

@@ -630,7 +630,7 @@ trait MarkupParser extends MarkupParserCommon with TokenTests {
630630
}
631631
nextch()
632632
val str = cbuf.toString()
633-
cbuf.length = 0
633+
cbuf.setLength(0)
634634
str
635635
}
636636

@@ -653,7 +653,7 @@ trait MarkupParser extends MarkupParserCommon with TokenTests {
653653
}
654654
nextch()
655655
val str = cbuf.toString
656-
cbuf.length = 0
656+
cbuf.setLength(0)
657657
str
658658
}
659659

@@ -799,7 +799,7 @@ trait MarkupParser extends MarkupParserCommon with TokenTests {
799799
//Console.println("END["+ch+"]")
800800
nextch()
801801
val cmstr = cbuf.toString()
802-
cbuf.length = 0
802+
cbuf.setLength(0)
803803
handle.elemDecl(n, cmstr)
804804
}
805805

@@ -826,7 +826,7 @@ trait MarkupParser extends MarkupParserCommon with TokenTests {
826826
nextch()
827827
}
828828
val atpe = cbuf.toString
829-
cbuf.length = 0
829+
cbuf.setLength(0)
830830

831831
val defdecl: DefaultDecl = ch match {
832832
case '\'' | '"' =>
@@ -846,7 +846,7 @@ trait MarkupParser extends MarkupParserCommon with TokenTests {
846846
xSpaceOpt()
847847

848848
attList ::= AttrDecl(aname, atpe, defdecl)
849-
cbuf.length = 0
849+
cbuf.setLength(0)
850850
}
851851
nextch()
852852
handle.attListDecl(n, attList.reverse)

0 commit comments

Comments
 (0)