From ff29187c639cdb032debdb036d2c9062f77879b0 Mon Sep 17 00:00:00 2001
From: Brian Norris <banorris@uci.edu>
Date: Mon, 4 Feb 2013 16:24:36 -0800
Subject: [PATCH] cyclegraph: edit template for checkReachable

---
 cyclegraph.cc | 18 ------------------
 cyclegraph.h  | 18 ++++++++++++++++++
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/cyclegraph.cc b/cyclegraph.cc
index 16990b9..d2a032e 100644
--- a/cyclegraph.cc
+++ b/cyclegraph.cc
@@ -265,24 +265,6 @@ void CycleGraph::dumpGraphToFile(const char *filename) const
 }
 #endif
 
-/**
- * Checks whether one ModelAction can reach another ModelAction/Promise
- * @param from The ModelAction from which to begin exploration
- * @param to The ModelAction or Promise to reach
- * @return True, @a from can reach @a to; otherwise, false
- */
-template <typename T>
-bool CycleGraph::checkReachable(const ModelAction *from, const T *to) const
-{
-	CycleNode *fromnode = actionToNode.get(from);
-	CycleNode *tonode = actionToNode.get(to);
-
-	if (!fromnode || !tonode)
-		return false;
-
-	return checkReachable(fromnode, tonode);
-}
-
 /**
  * Checks whether one CycleNode can reach another.
  * @param from The CycleNode from which to begin exploration
diff --git a/cyclegraph.h b/cyclegraph.h
index 9fc789c..83d3db2 100644
--- a/cyclegraph.h
+++ b/cyclegraph.h
@@ -154,4 +154,22 @@ void CycleGraph::addEdge(const T from, const U to)
 	addNodeEdge(fromnode, tonode);
 }
 
+/**
+ * Checks whether one ModelAction can reach another ModelAction/Promise
+ * @param from The ModelAction from which to begin exploration
+ * @param to The ModelAction or Promise to reach
+ * @return True, @a from can reach @a to; otherwise, false
+ */
+template <typename T>
+bool CycleGraph::checkReachable(const ModelAction *from, const T *to) const
+{
+	CycleNode *fromnode = getNode_noCreate(from);
+	CycleNode *tonode = getNode_noCreate(to);
+
+	if (!fromnode || !tonode)
+		return false;
+
+	return checkReachable(fromnode, tonode);
+}
+
 #endif /* __CYCLEGRAPH_H__ */
-- 
2.34.1