bug fix on skipReverse options.
Project: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/commit/03af01e1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/tree/03af01e1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/diff/03af01e1 Branch: refs/heads/master Commit: 03af01e1928b0370a19db82b9c863abc56360e94 Parents: 4bce75b Author: DO YUNG YOON <[email protected]> Authored: Wed Mar 16 17:02:03 2016 +0900 Committer: DO YUNG YOON <[email protected]> Committed: Thu Nov 10 05:48:04 2016 +0900 ---------------------------------------------------------------------- s2core/src/main/scala/org/apache/s2graph/core/Edge.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/03af01e1/s2core/src/main/scala/org/apache/s2graph/core/Edge.scala ---------------------------------------------------------------------- diff --git a/s2core/src/main/scala/org/apache/s2graph/core/Edge.scala b/s2core/src/main/scala/org/apache/s2graph/core/Edge.scala index 8813313..cb7b820 100644 --- a/s2core/src/main/scala/org/apache/s2graph/core/Edge.scala +++ b/s2core/src/main/scala/org/apache/s2graph/core/Edge.scala @@ -155,12 +155,12 @@ case class Edge(srcVertex: Vertex, def relatedEdges = { if (labelWithDir.isDirected) { - List(this, duplicateEdge) + val skipReverse = label.extraOptions.get("skipReverse").map(_.as[Boolean]).getOrElse(false) + if (skipReverse) List(this) else List(this, duplicateEdge) } else { val outDir = labelWithDir.copy(dir = GraphUtil.directions("out")) val base = copy(labelWithDir = outDir) - val skipReverse = label.extraOptions.get("skipReverse").map(_.as[Boolean]).getOrElse(false) - if (skipReverse) List(base) else List(base, base.reverseSrcTgtEdge) + List(base, base.reverseSrcTgtEdge) } }
