forked from OSchip/llvm-project
[clang-tidy] Fix logic of assertion
This commit is contained in:
parent
03ea140b3a
commit
07c6635901
|
@ -108,10 +108,8 @@ void ContainerContainsCheck::check(const MatchFinder::MatchResult &Result) {
|
|||
Result.Nodes.getNodeAs<Expr>("positiveComparison");
|
||||
const auto *NegativeComparison =
|
||||
Result.Nodes.getNodeAs<Expr>("negativeComparison");
|
||||
assert(
|
||||
!PositiveComparison ||
|
||||
!NegativeComparison &&
|
||||
"only one of PositiveComparison or NegativeComparison should be set");
|
||||
assert((!PositiveComparison || !NegativeComparison) &&
|
||||
"only one of PositiveComparison or NegativeComparison should be set");
|
||||
bool Negated = NegativeComparison != nullptr;
|
||||
const auto *Comparison = Negated ? NegativeComparison : PositiveComparison;
|
||||
|
||||
|
|
Loading…
Reference in New Issue