3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-13 12:28:44 +00:00

Z3_subst: avoid unneded cache lookups

This commit is contained in:
Nuno Lopes 2021-03-01 10:31:48 +00:00
parent f725989225
commit ff1429413d

View file

@ -67,18 +67,16 @@ void expr_safe_replace::operator()(expr* e, expr_ref& res) {
m_args.reset();
bool arg_differs = false, has_all_args = true;
for (expr* arg : *c) {
expr* d = m_cache[arg];
if (d) {
if (has_all_args) {
if (has_all_args) {
if (expr* d = m_cache[arg]) {
m_args.push_back(d);
arg_differs |= arg != d;
SASSERT(arg->get_sort() == d->get_sort());
continue;
}
}
else {
m_todo.push_back(arg);
has_all_args = false;
}
m_todo.push_back(arg);
has_all_args = false;
}
if (has_all_args) {
if (arg_differs) {