Skip to content

Commit

Permalink
Attempt to make life easier for bugprone-unchecked-optional-access
Browse files Browse the repository at this point in the history
  • Loading branch information
bifurcation committed Jul 13, 2023
1 parent 57b5e34 commit 66b56cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/mls_vectors/src/tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ TreeTestCase::commit(LeafIndex from,
}

// Add a private entry for the joiner if we added someone
if (!joiner.empty()) {
// XXX(RLB): These checks are unnecessary in principle, but clang-tidy's
// checker for bugprone-unchecked-optional-access crashes without them.
if (!joiner.empty() && maybe_enc_priv && maybe_sig_priv) {
auto index = joiner.front();
auto ancestor = index.ancestor(from);
auto enc_priv = opt::get(maybe_enc_priv);
Expand Down

0 comments on commit 66b56cd

Please sign in to comment.