Skip to content

Commit

Permalink
Enable -Wunused-variable in glean/PACKAGE
Browse files Browse the repository at this point in the history
Summary:
This diff enables compilation warning flags for the directory in question. Further details are in [this workplace post](https://fb.workplace.com/permalink.php?story_fbid=pfbid02XaWNiCVk69r1ghfvDVpujB8Hr9Y61uDvNakxiZFa2jwiPHscVdEQwCBHrmWZSyMRl&id=100051201402394).

This is a low-risk diff. There are **no run-time effects** and the diff has already been observed to compile locally. **If the code compiles, it work; test errors are spurious.**

Reviewed By: palmje

Differential Revision: D66847527

fbshipit-source-id: be53693c0d05047e6b0fe28238a1491e1ec7b006
  • Loading branch information
r-barnes authored and facebook-github-bot committed Dec 13, 2024
1 parent 03be46f commit 3c5ce2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions glean/rocksdb/database-impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,15 @@ struct SeekIterator final : rts::FactIterator {
Fact::Ref get(Demand demand) override {
if (iter_->Valid()) {
auto key = input(iter_->key());
auto ty = key.fixed<Pid>();
assert(ty == type_);
assert(key.fixed<Pid>() == type_);
auto value = input(iter_->value());
auto id = value.fixed<Id>();
assert(value.empty());

if (demand == KeyOnly) {
return Fact::Ref{id, type_, Fact::Clause::fromKey(key.bytes())};
} else {
auto found = db_->lookupById(id, slice_);
[[maybe_unused]] auto found = db_->lookupById(id, slice_);
assert(found);
return decomposeFact(id, slice_);
}
Expand Down
5 changes: 2 additions & 3 deletions glean/rts/stacked.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,11 @@ struct Stacked<Define> final : StackedBase<Define> {
// 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) {
bool found = base->factById(id, [&](auto, auto found) {
assert(base->factById(id, [&](auto, auto found) {
if (clause.value() != found.value()) {
id = Id::invalid();
}
});
assert(found);
}));
}
return id;
}
Expand Down

0 comments on commit 3c5ce2c

Please sign in to comment.