File tree 3 files changed +6
-6
lines changed
shared/src/main/scala/scala/xml
3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ class Document extends NodeSeq with Serializable {
36
36
* excluded. If there is a document type declaration, the list also
37
37
* contains a document type declaration information item.
38
38
*/
39
- var children : Seq [Node ] = _
39
+ var children : Seq [Node ] = _ // effectively an `immutable.Seq`, not changed due to binary compatibility
40
40
41
41
/** The element information item corresponding to the document element. */
42
42
var docElem : Node = _
Original file line number Diff line number Diff line change @@ -354,6 +354,7 @@ object Utility extends AnyRef with parsing.TokenTests {
354
354
null
355
355
}
356
356
357
+ // unused, untested
357
358
def parseAttributeValue (value : String ): Seq [Node ] = {
358
359
val sb : StringBuilder = new StringBuilder
359
360
var rfb : StringBuilder = null
@@ -398,7 +399,7 @@ object Utility extends AnyRef with parsing.TokenTests {
398
399
else
399
400
nb += x
400
401
}
401
- nb
402
+ nb.toVector
402
403
}
403
404
404
405
/**
Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ trait MarkupParser extends MarkupParserCommon with TokenTests {
242
242
}
243
243
244
244
nextch() // is prolog ?
245
- var children : NodeSeq = null
245
+ var children : Seq [ Node ] = null
246
246
if ('?' == ch) {
247
247
nextch()
248
248
info_prolog = prolog()
@@ -255,7 +255,7 @@ trait MarkupParser extends MarkupParserCommon with TokenTests {
255
255
val ts : NodeBuffer = new NodeBuffer ()
256
256
content1(TopScope , ts) // DTD handled as side effect
257
257
ts &+ content(TopScope )
258
- children = NodeSeq .fromSeq(ts)
258
+ children = ts.toVector
259
259
}
260
260
// println("[MarkupParser::document] children now: "+children.toList)
261
261
var elemCount : Int = 0
@@ -451,8 +451,7 @@ trait MarkupParser extends MarkupParserCommon with TokenTests {
451
451
def content (pscope : NamespaceBinding ): NodeSeq = {
452
452
val ts : NodeBuffer = new NodeBuffer
453
453
var exit : Boolean = eof
454
- // todo: optimize seq repr.
455
- def done : NodeSeq = NodeSeq .fromSeq(ts.toList)
454
+ def done : NodeSeq = NodeSeq .fromSeq(ts.toVector)
456
455
457
456
while (! exit) {
458
457
tmppos = pos
You can’t perform that action at this time.
0 commit comments