llvm-project/clang-tools-extra/test
Adrian Vogelsgesang 3696c70e67 [clang-tidy] Add `readability-container-contains` check
This commit introduces a new check `readability-container-contains` which finds
usages of `container.count()` and `container.find() != container.end()` and
instead recommends the `container.contains()` method introduced in C++20.

For containers which permit multiple entries per key (`multimap`, `multiset`,
...), `contains` is more efficient than `count` because `count` has to do
unnecessary additional work.

While this this performance difference does not exist for containers with only
a single entry per key (`map`, `unordered_map`, ...), `contains` still conveys
the intent better.

Reviewed By: xazax.hun, whisperity

Differential Revision: http://reviews.llvm.org/D112646
2022-01-24 12:57:18 +01:00
..
Unit
clang-apply-replacements [clang-apply-replacements] Correctly handle relative paths 2021-11-11 18:28:43 +00:00
clang-change-namespace Update redirected output file. 2020-06-19 23:30:16 -07:00
clang-doc [clang-doc] Improving Markdown Output 2020-03-06 17:37:08 -08:00
clang-include-fixer [lit] Fix another test case that r374652 missed 2019-10-16 23:58:58 +00:00
clang-move [clang-tools-extra] NFC: Fix trivial typo in documents and comments 2020-04-05 15:28:40 +09:00
clang-query [clang-tooling] Prevent llvm::fatal_error on invalid CLI option 2021-01-29 10:15:06 +01:00
clang-reorder-fields
clang-tidy [clang-tidy] Add `readability-container-contains` check 2022-01-24 12:57:18 +01:00
modularize [NFC][clang-tools-extra] Inclusive language: replace master with main 2021-11-25 11:01:16 -06:00
pp-trace [clang] Let PPCallbacks::PragmaWarning() pass specifier as enum instead of string 2021-09-28 19:47:27 -04:00
.clang-format
CMakeLists.txt [libclang] Remove LIBCLANG_INCLUDE_CLANG_TOOLS_EXTRA 2021-03-01 13:21:59 -05:00
lit.cfg.py Add an explicit toggle for the static analyzer in clang-tidy 2020-09-10 10:48:17 -04:00
lit.site.cfg.py.in [libclang] Remove LIBCLANG_INCLUDE_CLANG_TOOLS_EXTRA 2021-03-01 13:21:59 -05:00