@@ -224,17 +224,16 @@ object Utility extends AnyRef with parsing.TokenTests {
224224 minimizeTags : MinimizeMode .Value ,
225225 sb : StringBuilder
226226 ): Unit = {
227- @ tailrec def ser (nss : List [Seq [Node ]], pscopes : List [NamespaceBinding ], spaced : List [Boolean ], toClose : List [Node ]): Unit = nss match {
228- case List (ns) if ns.isEmpty =>
229- case ns :: rests if ns.isEmpty =>
227+ @ tailrec def ser (nss : List [List [Node ]], pscopes : List [NamespaceBinding ], spaced : List [Boolean ], toClose : List [Node ]): Unit = nss match {
228+ case List (Nil ) =>
229+ case Nil :: rests =>
230230 if (toClose.head != null ) {
231231 sb.append(" </" )
232232 toClose.head.nameToString(sb)
233233 sb.append('>' )
234234 }
235235 ser(rests, pscopes.tail, spaced.tail, toClose.tail)
236- case ns1 :: r =>
237- val (n, ns) = (ns1.head, ns1.tail)
236+ case (n :: ns) :: r =>
238237 def sp (): Unit = if (ns.nonEmpty && spaced.head) sb.append(' ' )
239238 n match {
240239 case c : Comment =>
@@ -248,7 +247,7 @@ object Utility extends AnyRef with parsing.TokenTests {
248247 sp()
249248 ser(ns :: r, pscopes, spaced, toClose)
250249 case g : Group =>
251- ser(g.nodes :: ns :: r, g.scope :: pscopes, false :: spaced, null :: toClose)
250+ ser(g.nodes.toList :: ns :: r, g.scope :: pscopes, false :: spaced, null :: toClose)
252251 case e : Elem =>
253252 sb.append('<' )
254253 e.nameToString(sb)
@@ -264,12 +263,12 @@ object Utility extends AnyRef with parsing.TokenTests {
264263 } else {
265264 sb.append('>' )
266265 val csp = e.child.forall(isAtomAndNotText)
267- ser(e.child :: ns :: r, e.scope :: pscopes, csp :: spaced, e :: toClose)
266+ ser(e.child.toList :: ns :: r, e.scope :: pscopes, csp :: spaced, e :: toClose)
268267 }
269268 case n => throw new IllegalArgumentException (" Don't know how to serialize a " + n.getClass.getName)
270269 }
271270 }
272- ser(List (ns), List (pscope), List (spaced), Nil )
271+ ser(List (ns.toList ), List (pscope), List (spaced), Nil )
273272 }
274273
275274 def sequenceToXML (
0 commit comments