src/Pure/PIDE/document.scala
changeset 57616 50ab1db5c0fd
parent 57615 df1b3452d71c
child 57617 335750d989a3
     1.1 --- a/src/Pure/PIDE/document.scala	Wed Jul 23 13:01:30 2014 +0200
     1.2 +++ b/src/Pure/PIDE/document.scala	Wed Jul 23 14:50:20 2014 +0200
     1.3 @@ -293,9 +293,6 @@
     1.4  
     1.5    final class Nodes private(graph: Graph[Node.Name, Node])
     1.6    {
     1.7 -    def get_name(s: String): Option[Node.Name] =
     1.8 -      graph.keys_iterator.find(name => name.node == s)
     1.9 -
    1.10      def apply(name: Node.Name): Node =
    1.11        graph.default_node(name, Node.empty).get_node(name)
    1.12  
    1.13 @@ -307,7 +304,10 @@
    1.14          (graph.default_node(name, Node.empty) /: imports)((g, p) => g.default_node(p, Node.empty))
    1.15        val graph2 = (graph1 /: graph1.imm_preds(name))((g, dep) => g.del_edge(dep, name))
    1.16        val graph3 = (graph2 /: imports)((g, dep) => g.add_edge(dep, name))
    1.17 -      new Nodes(graph3.map_node(name, _ => node))
    1.18 +      new Nodes(
    1.19 +        if (graph3.is_maximal(name) && node.is_empty) graph3.del_node(name)
    1.20 +        else graph3.map_node(name, _ => node)
    1.21 +      )
    1.22      }
    1.23  
    1.24      def iterator: Iterator[(Node.Name, Node)] =