From 1a3b7518cc84a180455ccce43aa01e98334298a1 Mon Sep 17 00:00:00 2001 From: "Aaron S. Hawley" Date: Sun, 27 May 2018 01:44:25 -0400 Subject: [PATCH] Drop varargs with Utility.combineAdjacentTextNodes --- shared/src/main/scala/scala/xml/Utility.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared/src/main/scala/scala/xml/Utility.scala b/shared/src/main/scala/scala/xml/Utility.scala index 59169af71..bd974b3e7 100755 --- a/shared/src/main/scala/scala/xml/Utility.scala +++ b/shared/src/main/scala/scala/xml/Utility.scala @@ -46,11 +46,11 @@ object Utility extends AnyRef with parsing.TokenTests { */ def trim(x: Node): Node = x match { case Elem(pre, lab, md, scp, child@_*) => - val children = combineAdjacentTextNodes(child:_*) flatMap trimProper + val children = combineAdjacentTextNodes(child) flatMap trimProper Elem(pre, lab, md, scp, children.isEmpty, children: _*) } - private def combineAdjacentTextNodes(children: Node*): Seq[Node] = { + private def combineAdjacentTextNodes(children: Seq[Node]): Seq[Node] = { children.foldRight(Seq.empty[Node]) { case (Text(left), Text(right) +: nodes) => Text(left + right) +: nodes case (n, nodes) => n +: nodes @@ -63,7 +63,7 @@ object Utility extends AnyRef with parsing.TokenTests { */ def trimProper(x: Node): Seq[Node] = x match { case Elem(pre, lab, md, scp, child@_*) => - val children = combineAdjacentTextNodes(child:_*) flatMap trimProper + val children = combineAdjacentTextNodes(child) flatMap trimProper Elem(pre, lab, md, scp, children.isEmpty, children: _*) case Text(s) => new TextBuffer().append(s).toText