3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-19 07:06:28 +00:00

Remove redundant check for reference count in cache

This commit is contained in:
Nikolaj Bjorner 2026-06-16 09:35:51 -06:00 committed by GitHub
parent eb775b2206
commit c48a4aa56a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -261,13 +261,13 @@ struct goal2sat::imp : public sat::sat_internalizer {
void cache(app* t, sat::literal l) override {
force_push();
if (t->get_ref_count() <= 1)
return;
m_cache_trail.push_back(t);
// Only memoize nodes that can be revisited: a singly-referenced
// node appears once in the goal, so it never produces a cache hit.
// Skipping it keeps m_app2lit and m_lit2app in sync (both empty for
// such nodes) so pop()/uncache() clean up consistently.
if (t->get_ref_count() <= 1)
return;
SASSERT(!m_app2lit.contains(t));
SASSERT(!m_lit2app.contains(l.index()));
m_app2lit.insert(t, l);