Github user huafengw commented on a diff in the pull request: https://github.com/apache/incubator-gearpump/pull/223#discussion_r138881132 --- Diff: core/src/main/scala/org/apache/gearpump/util/Graph.scala --- @@ -243,13 +259,34 @@ class Graph[N, E](vertexList: List[N], edgeList: List[(N, E, N)]) extends Serial * The node returned by Iterator is stable sorted. */ def topologicalOrderIterator: Iterator[N] = { - val newGraph = copy - var output = List.empty[N] - - while (!newGraph.isEmpty) { - output ++= newGraph.removeZeroInDegree + tryTopologicalOrderIterator.get --- End diff -- I think exception is better than dead loop
---