tuned;
authorwenzelm
Fri, 18 Dec 2009 16:52:36 +0100
changeset 34133 17554065f3be
parent 34132 7492eca87ab4
child 34134 d8d9df8407f6
child 34148 5aa816a3f78a
tuned;
src/Pure/General/xml.scala
--- a/src/Pure/General/xml.scala	Fri Dec 18 15:33:44 2009 +0100
+++ b/src/Pure/General/xml.scala	Fri Dec 18 16:52:36 2009 +0100
@@ -123,10 +123,12 @@
         case None => store(x)
       }
     def cache_props(x: List[(String, String)]): List[(String, String)] =
-      lookup(x) match {
-        case Some(y) => y
-        case None => store(x.map(p => (cache_string(p._1), cache_string(p._2))))
-      }
+      if (x.isEmpty) x
+      else
+        lookup(x) match {
+          case Some(y) => y
+          case None => store(x.map(p => (cache_string(p._1), cache_string(p._2))))
+        }
     def cache_tree(x: XML.Tree): XML.Tree =
       lookup(x) match {
         case Some(y) => y
@@ -138,10 +140,12 @@
           }
       }
     def cache_trees(x: List[XML.Tree]): List[XML.Tree] =
-      lookup(x) match {
-        case Some(y) => y
-        case None => x.map(cache_tree(_))
-      }
+      if (x.isEmpty) x
+      else
+        lookup(x) match {
+          case Some(y) => y
+          case None => x.map(cache_tree(_))
+        }
   }