diff options
Diffstat (limited to 'src/library/scala/xml/NodeBuffer.scala')
-rw-r--r-- | src/library/scala/xml/NodeBuffer.scala | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/library/scala/xml/NodeBuffer.scala b/src/library/scala/xml/NodeBuffer.scala index 4bc4b61ab1..0e7e1b665e 100644 --- a/src/library/scala/xml/NodeBuffer.scala +++ b/src/library/scala/xml/NodeBuffer.scala @@ -37,24 +37,19 @@ class NodeBuffer extends scala.collection.mutable.ArrayBuffer[Node] { */ def &+(o: Any): NodeBuffer = { o match { - case null => // ignore null - - case _:Unit => + case null | _:Unit | Text("")=> // ignore - case it:Iterator[_] => - while(it.hasNext) { + + case it:Iterator[_] => + while(it.hasNext) this &+ it.next - } + case n:Node => super.+(n) + case ns:Iterable[_] => - val it = ns.elements - while (it.hasNext) { - this &+ it.next - //if (it.hasNext) - // this &+ " "; - } - //case s:String => super.+(Text(o.toString())); + this &+ ns.elements + case d => super.+(new Atom(d)) } |