[clang-tidy][NFC] Fix clang-format (#192044)

This commit is contained in:
Baranov Victor
2026-04-14 15:43:23 +03:00
committed by GitHub
parent 0d20c873dd
commit 6cfbc25102
2 changed files with 11 additions and 10 deletions

View File

@@ -166,14 +166,13 @@ void RedundantBranchConditionCheck::check(
CondOp->getRHS()->getBeginLoc().getLocWithOffset(-1);
Diag << FixItHint::CreateRemoval(CharSourceRange::getTokenRange(
CondOp->getLHS()->getBeginLoc(), BeforeRHS));
} else {
if (const auto NextToken = utils::lexer::findNextTokenSkippingComments(
CondOp->getLHS()->getEndLoc(), *Result.SourceManager,
getLangOpts())) {
const SourceLocation AfterLHS = NextToken->getLocation();
Diag << FixItHint::CreateRemoval(CharSourceRange::getTokenRange(
AfterLHS, CondOp->getRHS()->getEndLoc()));
}
} else if (const auto NextToken =
utils::lexer::findNextTokenSkippingComments(
CondOp->getLHS()->getEndLoc(), *Result.SourceManager,
getLangOpts())) {
const SourceLocation AfterLHS = NextToken->getLocation();
Diag << FixItHint::CreateRemoval(CharSourceRange::getTokenRange(
AfterLHS, CondOp->getRHS()->getEndLoc()));
}
}
}

View File

@@ -66,16 +66,18 @@ static bool containsMisleadingBidi(StringRef Buffer,
if (CodePoint == RLO || CodePoint == RLE || CodePoint == LRO ||
CodePoint == LRE) {
BidiContexts.push_back(PDF);
}
// Close PDF Context.
} else if (CodePoint == PDF) {
else if (CodePoint == PDF) {
if (!BidiContexts.empty() && BidiContexts.back() == PDF)
BidiContexts.pop_back();
}
// Open a PDI Context.
else if (CodePoint == RLI || CodePoint == LRI || CodePoint == FSI) {
BidiContexts.push_back(PDI);
}
// Close a PDI Context.
} else if (CodePoint == PDI) {
else if (CodePoint == PDI) {
auto R = llvm::find(llvm::reverse(BidiContexts), PDI);
if (R != BidiContexts.rend())
BidiContexts.resize(BidiContexts.rend() - R - 1);