================
@@ -55,8 +61,7 @@ void
FasterStringFindCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
}
void FasterStringFindCheck::registerMatchers(MatchFinder *Finder) {
- const auto SingleChar =
- ignoringParenCasts(stringLiteral(hasSize(1)).bind("literal"));
+ const auto SingleChar = expr().bind("literal");
----------------
localspook wrote:
I don't really like that we would be introducing repetition into the code
I could stick this part:
```cpp
if (!utils::forAllLeavesOfTernaryTree(Literal, [](const Expr *E) {
const auto *Literal = dyn_cast<StringLiteral>(E);
return Literal && Literal->getLength() == 1;
}))
return;
```
into a custom matcher though
https://github.com/llvm/llvm-project/pull/187069
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits