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 7fadcbd..44f5a28 100644 (file)
@@ -443,6 +443,8 @@ bool CycleGraph::checkPromise(const ModelAction *fromact, Promise *promise) cons
                CycleNode *node = queue.back();
                queue.pop_back();
 
                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;
                if (!node->is_promise() &&
                                promise->eliminate_thread(node->getAction()->get_tid()))
                        return true;