[clang-tools-extra] [clang-tidy] Add new modernize-string-find-startswith check (PR #72385)

Oliver Stöneberg via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 15 07:25:58 PST 2023


firewave wrote:

I wonder if this should also detect the `str.compare("marker", 0, 6) == 0` pattern. There is possibly some kind of pattern involving `std::equal()` as well. Could as well be a different check though.

Not sure if it would have a performance impact to use `starts_with()` instead though.

https://github.com/llvm/llvm-project/pull/72385


More information about the cfe-commits mailing list