cyclegraph: possible optimization
authorBrian Norris <banorris@uci.edu>
Sat, 9 Feb 2013 00:34:33 +0000 (16:34 -0800)
committerBrian Norris <banorris@uci.edu>
Sat, 9 Feb 2013 00:34:33 +0000 (16:34 -0800)
cyclegraph.cc

index 7fadcbda00d8b6f02f9cfe81d5cd3f423e9a3a2b..44f5a28bc15b69cc3289a4906b298341845ae324 100644 (file)
@@ -443,6 +443,8 @@ bool CycleGraph::checkPromise(const ModelAction *fromact, Promise *promise) cons
                CycleNode *node = queue.back();
                queue.pop_back();
 
+               if (node->getPromise() == promise)
+                       return true;
                if (!node->is_promise() &&
                                promise->eliminate_thread(node->getAction()->get_tid()))
                        return true;