perf(kernel/justification): remove cache from depends_on

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-10-25 10:26:05 -07:00
parent 2b5c951de3
commit 5812dfcf44

View file

@ -4,7 +4,6 @@ Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura Author: Leonardo de Moura
*/ */
#include <set>
#include "util/buffer.h" #include "util/buffer.h"
#include "kernel/justification.h" #include "kernel/justification.h"
@ -42,7 +41,6 @@ bool justification::has_children() const {
bool depends_on(justification const & t, justification const & d) { bool depends_on(justification const & t, justification const & d) {
buffer<justification_cell *> todo; buffer<justification_cell *> todo;
std::set<justification_cell *> visited;
buffer<justification_cell *> children; buffer<justification_cell *> children;
todo.push_back(t.raw()); todo.push_back(t.raw());
while (!todo.empty()) { while (!todo.empty()) {
@ -54,15 +52,8 @@ bool depends_on(justification const & t, justification const & d) {
children.clear(); children.clear();
curr->get_children(children); curr->get_children(children);
for (justification_cell * child : children) { for (justification_cell * child : children) {
if (child->is_shared()) {
if (visited.find(child) == visited.end()) {
visited.insert(child);
todo.push_back(child); todo.push_back(child);
} }
} else {
todo.push_back(child);
}
}
} }
} }
return false; return false;