diff --git a/glean/rocksdb/database-impl.cpp b/glean/rocksdb/database-impl.cpp index 61c4aae48..fb91b604e 100644 --- a/glean/rocksdb/database-impl.cpp +++ b/glean/rocksdb/database-impl.cpp @@ -269,7 +269,8 @@ struct SeekIterator final : rts::FactIterator { Fact::Ref get(Demand demand) override { if (iter_->Valid()) { auto key = input(iter_->key()); - assert(key.fixed() == type_); + auto ty = key.fixed(); + assert(ty == type_); auto value = input(iter_->value()); auto id = value.fixed(); assert(value.empty()); @@ -277,7 +278,7 @@ struct SeekIterator final : rts::FactIterator { if (demand == KeyOnly) { return Fact::Ref{id, type_, Fact::Clause::fromKey(key.bytes())}; } else { - [[maybe_unused]] auto found = db_->lookupById(id, slice_); + auto found = db_->lookupById(id, slice_); assert(found); return decomposeFact(id, slice_); } diff --git a/glean/rts/stacked.h b/glean/rts/stacked.h index 13aa95a7f..0c36f512c 100644 --- a/glean/rts/stacked.h +++ b/glean/rts/stacked.h @@ -160,11 +160,12 @@ struct Stacked final : StackedBase { // similar). This means that there is no need to check against the // value stored in the database as that must be empty, too. if (clause.value_size != 0) { - assert(base->factById(id, [&](auto, auto found) { + bool found = base->factById(id, [&](auto, auto found) { if (clause.value() != found.value()) { id = Id::invalid(); } - })); + }); + assert(found); } return id; }