perf(kernel/justification): remove cache from depends_on
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
2b5c951de3
commit
5812dfcf44
1 changed files with 1 additions and 10 deletions
|
@ -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,14 +52,7 @@ 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()) {
|
todo.push_back(child);
|
||||||
if (visited.find(child) == visited.end()) {
|
|
||||||
visited.insert(child);
|
|
||||||
todo.push_back(child);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
todo.push_back(child);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue