From 5fb5c966a020d1b79118aae65b6b113e5edc7606 Mon Sep 17 00:00:00 2001 From: Emily Fertig Date: Wed, 18 Sep 2024 03:46:41 +0000 Subject: [PATCH] Fix bug turned up by compiling in fastbuild mode. --- cxx/gendb.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cxx/gendb.cc b/cxx/gendb.cc index e963b7b..0206f37 100644 --- a/cxx/gendb.cc +++ b/cxx/gendb.cc @@ -117,8 +117,13 @@ void GenDB::incorporate_query_relation(std::mt19937* prng, T_noisy_relation t_query_rel = std::get(hirm->schema.at(query_rel_name)); - hirm->sample_and_incorporate_relation(prng, t_query_rel.base_relation, - base_items); + bool base_contains_items = std::visit( + [&](auto rel) { return rel->get_data().contains(base_items); }, + hirm->get_relation(t_query_rel.base_relation)); + if (!base_contains_items) { + hirm->sample_and_incorporate_relation(prng, t_query_rel.base_relation, + base_items); + } hirm->incorporate(prng, query_rel_name, items, value); }